SlideShare a Scribd company logo
1 of 42
Download to read offline
How to debug
Microservices on
Kubernetes as a pros
KAI CHU CHUNG
GDGCloud co-organizer
GDE(Cloud)
“How to debug Microservices
on Kubernetes as a pros”
1. Debug
2. Microservice
3. Kubernetes
Agenda
Debug
1. Local
2. Container
3. Cloud Debugger
Debug
Local (Golang)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
fmt.Fprintf(w, "hello devfest 2020 tw")
})
port := os.Getenv("PORT")
if port == "" {
port = "8080"
log.Printf("Defaulting to port %s", port)
}
log.Printf("Listening on port %s", port)
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%s", port), nil))
}
Local (Python)
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return 'hello devfest 2020 tw'
if __name__ == '__main__':
app.debug = True
app.run()
Summary: Local
Containers allow you
to package your
application and its
dependencies together
into one succinct
manifest
What are Containers and their benefits | Google Cloud - https://cloud.google.com/containers
1. Dockerfile
2. buildpacks
Container
Dockerfile (Golang)
FROM golang:1.15 AS builder
WORKDIR /workspace
# Install dependencies in go.mod and go.sum
COPY go.mod go.sum ./
RUN go mod download
# Copy rest of the application source code
COPY . ./
# Compile the application to /app.
RUN go build -o /exe -v ./
FROM gcr.io/distroless/base:latest
COPY --from=builder /exe .
ENTRYPOINT ["/exe"]
Dockerfile (Golang debug)
FROM golang:1.15
# Download the dlv (delve) debugger for go
RUN go get -u -v github.com/go-delve/delve/cmd/dlv
WORKDIR /workspace
# Install dependencies in go.mod and go.sum
COPY go.mod go.sum ./
RUN go mod download
# Copy rest of the application source code
COPY . ./
RUN go build -o /exe -v ./
ENTRYPOINT ["dlv", "exec", "/app", "--continue", "--accept-multiclient", "--api-version=2",
"--headless", "--listen=:3000", "--log"]
container with known vulnerabilities
Source: The state of open source security report 2019 by snyt
44%
Google Cloud Next ’20 OnAir - https://cloud.withgoogle.com/next/sf/onair?session=SVR227#application-modernization
1. CNCF sandbox projects
2. suggest builders
a. Google
b. Heroku
c. Paketo Buildpacks
Buildpacks
Buildpacks Go Cloud Native | Heroku - https://blog.heroku.com/buildpacks-go-cloud-native
1. Open source.
2. Creates secure
container images.
3. Designed for
running on Cloud
Run, GKE, Anthos.
Buildpacks
GoogleCloudPlatform/buildpacks - https://github.com/GoogleCloudPlatform/buildpacks
● Google Cloud maintains a set of open source
buildpacks for building containers to run on
GKE, Anthos, & Cloud Run
● Cloud Build native support for buildpacks
● Cloud Run direct source deployments w/
buildpacks
● Cloud Shell has pack pre-installed. App Engine
builds via buildpacks
● Cloud Functions builds via buildpacks
● Cloud Code deploy to Cloud Run with Buildpacks
● Skaffold native support for buildpacks
Buildpacks on Google Cloud
pack build aa --builder gcr.io/buildpacks/builder:v1
dive index.docker.io/library/aa:latest
wagoodman/dive: A tool for exploring each layer in a docker image - https://github.com/wagoodman/dive
Summary: Container
debugger
debugger
one
container
one
container
Microservice
Microservices refers to an
architectural style for
developing applications.
Microservices allow a large
application to be decomposed
into independent constituent
parts, with each part having
its own realm of
responsibility
.
├── build
├── cmd
├── deployments
├── internal
│ ├── app
│ │ ├── authnsvc
│ │ ├── authzsvc
│ │ ├── docs
│ │ ├── emailsvc
│ │ ├── invitesvc
│ │ ├── mappingsvc
│ │ ├── oauthagentsvc
│ │ ├── organizationsvc
│ │ ├── person_attribute
│ │ ├── report_statistics
│ │ ├── reportsvc
│ │ ├── storesvc
│ │ ├── streamsvc
│ │ └── ws
│ └── pkg
├── pb
├── scripts
├── test
├── cloudbuild-build.yaml
├── cloudbuild-dev-deploy.yaml
├── cloudbuild-dev-meta.yaml
├── cloudbuild-helm.yaml
├── cloudbuild-release-helm.yaml
├── cloudbuild-release-meta.yaml
├── cloudbuild-test.yaml
├── cloudbuild.plantuml
├── makefile
└── skaffold.yaml
Service Language Description
frontend Go
Exposes an HTTP server to serve the website. Does
not require signup/login and generates session
IDs for all users automatically.
cartservice C#
Stores the items in the user's shopping cart in
Redis and retrieves it.
productcatalogservice Go
Provides the list of products from a JSON file and
ability to search products and get individual
products.
currencyservice Node.js
Converts one money amount to another currency.
Uses real values fetched from European Central
Bank. It's the highest QPS service.
paymentservice Node.js
Charges the given credit card info (mock) with
the given amount and returns a transaction ID.
shippingservice Go
Gives shipping cost estimates based on the
shopping cart. Ships items to the given address
(mock)
emailservice Python Sends users an order confirmation email (mock).
checkoutservice Go
Retrieves user cart, prepares order and
orchestrates the payment, shipping and the email
notification.
recommendationservice Python
Recommends other products based on what's given
in the cart.
adservice Java Provides text ads based on given context words.
loadgenerator Python/Locust
Continuously sends requests imitating realistic
user shopping flows to the frontend.
GoogleCloudPlatform/microservices-demo - https://github.com/GoogleCloudPlatform/microservices-demo
Kubernetes
Kubernetes is a portable,
extensible, open-source
platform for managing
containerized workloads and
services, that facilitates
both declarative configuration
and automation. It has a
large, rapidly growing
ecosystem. Kubernetes
services, support, and tools
are widely available.
1
2
3
4
5
6
Change code
Run docker build
Run docker push
Patch yaml
Run kubectl apply
Verify
Kubernetes Development workflow
Skaffold handles the workflow
for building, pushing and
deploying your application,
allowing you to focus on what
matters most: writing code
1. Go (runtime ID: go)
2. NodeJS (runtime ID: nodejs)
3. Java and JVM languages
(runtime ID: jvm)
4. Python (runtime ID: python)
5. .NET Core (runtime ID:
netcore)
Skaffold debug (beta)
Cloud Code comes with tools
to help you write, run, and
debug cloud-native
applications quickly and
easily.
Cloud Code | Google Cloud - https://cloud.google.com/code
https://www.facebook.com/groups/GCPUG.TW

More Related Content

What's hot

Hiveminder - Everything but the Secret Sauce
Hiveminder - Everything but the Secret SauceHiveminder - Everything but the Secret Sauce
Hiveminder - Everything but the Secret SauceJesse Vincent
 
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...Puppet
 
Ship your Scala code often and easy with Docker
Ship your Scala code often and easy with DockerShip your Scala code often and easy with Docker
Ship your Scala code often and easy with DockerMarcus Lönnberg
 
Continuous Integration & Continuous Delivery with GCP
Continuous Integration & Continuous Delivery with GCPContinuous Integration & Continuous Delivery with GCP
Continuous Integration & Continuous Delivery with GCPKAI CHU CHUNG
 
GraphQL IN Golang
GraphQL IN GolangGraphQL IN Golang
GraphQL IN GolangBo-Yi Wu
 
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...ZeroTurnaround
 
CI : the first_step: Auto Testing with CircleCI - (MOSG)
CI : the first_step: Auto Testing with CircleCI - (MOSG)CI : the first_step: Auto Testing with CircleCI - (MOSG)
CI : the first_step: Auto Testing with CircleCI - (MOSG)Soshi Nemoto
 
PuppetConf 2016: Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
PuppetConf 2016:  Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...PuppetConf 2016:  Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
PuppetConf 2016: Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...Puppet
 
開放運算&GPU技術研究班
開放運算&GPU技術研究班開放運算&GPU技術研究班
開放運算&GPU技術研究班Paul Chao
 
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開60分鐘完送百萬edm,背後雲端ci/cd實戰大公開
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開KAI CHU CHUNG
 
Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012Rajmahendra Hegde
 
Google App Engine (GAE) 演進史
Google App Engine (GAE) 演進史Google App Engine (GAE) 演進史
Google App Engine (GAE) 演進史Simon Su
 
Managing dependencies with gradle
Managing dependencies with gradleManaging dependencies with gradle
Managing dependencies with gradleLiviu Tudor
 
Fabricio - Docker deploy automation
Fabricio - Docker deploy automationFabricio - Docker deploy automation
Fabricio - Docker deploy automationRinat Khabibiev
 
Continous delivery with sbt
Continous delivery with sbtContinous delivery with sbt
Continous delivery with sbtWojciech Pituła
 
Microservices on Kubernetes - The simple way
Microservices on Kubernetes - The simple wayMicroservices on Kubernetes - The simple way
Microservices on Kubernetes - The simple waySuraj Deshmukh
 

What's hot (20)

Hiveminder - Everything but the Secret Sauce
Hiveminder - Everything but the Secret SauceHiveminder - Everything but the Secret Sauce
Hiveminder - Everything but the Secret Sauce
 
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...
 
Rest, sockets em golang
Rest, sockets em golangRest, sockets em golang
Rest, sockets em golang
 
Ship your Scala code often and easy with Docker
Ship your Scala code often and easy with DockerShip your Scala code often and easy with Docker
Ship your Scala code often and easy with Docker
 
Continuous Integration & Continuous Delivery with GCP
Continuous Integration & Continuous Delivery with GCPContinuous Integration & Continuous Delivery with GCP
Continuous Integration & Continuous Delivery with GCP
 
GraphQL IN Golang
GraphQL IN GolangGraphQL IN Golang
GraphQL IN Golang
 
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
 
CI : the first_step: Auto Testing with CircleCI - (MOSG)
CI : the first_step: Auto Testing with CircleCI - (MOSG)CI : the first_step: Auto Testing with CircleCI - (MOSG)
CI : the first_step: Auto Testing with CircleCI - (MOSG)
 
PuppetConf 2016: Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
PuppetConf 2016:  Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...PuppetConf 2016:  Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
PuppetConf 2016: Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
 
開放運算&GPU技術研究班
開放運算&GPU技術研究班開放運算&GPU技術研究班
開放運算&GPU技術研究班
 
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開60分鐘完送百萬edm,背後雲端ci/cd實戰大公開
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開
 
Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012
 
Gradle Introduction
Gradle IntroductionGradle Introduction
Gradle Introduction
 
Introduction to Tekton
Introduction to TektonIntroduction to Tekton
Introduction to Tekton
 
Google App Engine (GAE) 演進史
Google App Engine (GAE) 演進史Google App Engine (GAE) 演進史
Google App Engine (GAE) 演進史
 
Android presentation - Gradle ++
Android presentation - Gradle ++Android presentation - Gradle ++
Android presentation - Gradle ++
 
Managing dependencies with gradle
Managing dependencies with gradleManaging dependencies with gradle
Managing dependencies with gradle
 
Fabricio - Docker deploy automation
Fabricio - Docker deploy automationFabricio - Docker deploy automation
Fabricio - Docker deploy automation
 
Continous delivery with sbt
Continous delivery with sbtContinous delivery with sbt
Continous delivery with sbt
 
Microservices on Kubernetes - The simple way
Microservices on Kubernetes - The simple wayMicroservices on Kubernetes - The simple way
Microservices on Kubernetes - The simple way
 

Similar to Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (https://youtu.be/eseo0hcRaQI?t=11008)

Kubernetes for the PHP developer
Kubernetes for the PHP developerKubernetes for the PHP developer
Kubernetes for the PHP developerPaul Czarkowski
 
Containers as a Service with Docker
Containers as a Service with DockerContainers as a Service with Docker
Containers as a Service with DockerDocker, Inc.
 
Docker Container As A Service - March 2016
Docker Container As A Service - March 2016Docker Container As A Service - March 2016
Docker Container As A Service - March 2016Patrick Chanezon
 
JDD2015: Kubernetes - Beyond the basics - Paul Bakker
JDD2015: Kubernetes - Beyond the basics - Paul BakkerJDD2015: Kubernetes - Beyond the basics - Paul Bakker
JDD2015: Kubernetes - Beyond the basics - Paul BakkerPROIDEA
 
Import golang; struct microservice
Import golang; struct microserviceImport golang; struct microservice
Import golang; struct microserviceGiulio De Donato
 
Microservices DevOps on Google Cloud Platform
Microservices DevOps on Google Cloud PlatformMicroservices DevOps on Google Cloud Platform
Microservices DevOps on Google Cloud PlatformSunnyvale
 
Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)HungWei Chiu
 
Docker Container As A Service - Mix-IT 2016
Docker Container As A Service - Mix-IT 2016Docker Container As A Service - Mix-IT 2016
Docker Container As A Service - Mix-IT 2016Patrick Chanezon
 
Building Web Apps Sanely - EclipseCon 2010
Building Web Apps Sanely - EclipseCon 2010Building Web Apps Sanely - EclipseCon 2010
Building Web Apps Sanely - EclipseCon 2010Chris Ramsdale
 
NuGet beyond Hello World - DotNext Piter 2017
NuGet beyond Hello World - DotNext Piter 2017NuGet beyond Hello World - DotNext Piter 2017
NuGet beyond Hello World - DotNext Piter 2017Maarten Balliauw
 
Introduction to Kubernetes and GKE
Introduction to Kubernetes and GKEIntroduction to Kubernetes and GKE
Introduction to Kubernetes and GKEOpsta
 
Native client
Native clientNative client
Native clientzyc901016
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to KubernetesPaul Czarkowski
 
Codetainer: a Docker-based browser code 'sandbox'
Codetainer: a Docker-based browser code 'sandbox'Codetainer: a Docker-based browser code 'sandbox'
Codetainer: a Docker-based browser code 'sandbox'Jen Andre
 
Physical Computing Using Go and Arduino
Physical Computing Using Go and ArduinoPhysical Computing Using Go and Arduino
Physical Computing Using Go and ArduinoJustin Grammens
 
A DevOps guide to Kubernetes
A DevOps guide to KubernetesA DevOps guide to Kubernetes
A DevOps guide to KubernetesPaul Czarkowski
 
Google Developer Fest 2010
Google Developer Fest 2010Google Developer Fest 2010
Google Developer Fest 2010Chris Ramsdale
 
Developing your first application using FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWAREFIWARE
 

Similar to Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (https://youtu.be/eseo0hcRaQI?t=11008) (20)

Kubernetes for the PHP developer
Kubernetes for the PHP developerKubernetes for the PHP developer
Kubernetes for the PHP developer
 
Containers as a Service with Docker
Containers as a Service with DockerContainers as a Service with Docker
Containers as a Service with Docker
 
Docker Container As A Service - March 2016
Docker Container As A Service - March 2016Docker Container As A Service - March 2016
Docker Container As A Service - March 2016
 
JDD2015: Kubernetes - Beyond the basics - Paul Bakker
JDD2015: Kubernetes - Beyond the basics - Paul BakkerJDD2015: Kubernetes - Beyond the basics - Paul Bakker
JDD2015: Kubernetes - Beyond the basics - Paul Bakker
 
Import golang; struct microservice
Import golang; struct microserviceImport golang; struct microservice
Import golang; struct microservice
 
Microservices DevOps on Google Cloud Platform
Microservices DevOps on Google Cloud PlatformMicroservices DevOps on Google Cloud Platform
Microservices DevOps on Google Cloud Platform
 
Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)
 
Excelian hyperledger walkthrough-feb17
Excelian hyperledger walkthrough-feb17Excelian hyperledger walkthrough-feb17
Excelian hyperledger walkthrough-feb17
 
Docker Container As A Service - Mix-IT 2016
Docker Container As A Service - Mix-IT 2016Docker Container As A Service - Mix-IT 2016
Docker Container As A Service - Mix-IT 2016
 
Building Web Apps Sanely - EclipseCon 2010
Building Web Apps Sanely - EclipseCon 2010Building Web Apps Sanely - EclipseCon 2010
Building Web Apps Sanely - EclipseCon 2010
 
NuGet beyond Hello World - DotNext Piter 2017
NuGet beyond Hello World - DotNext Piter 2017NuGet beyond Hello World - DotNext Piter 2017
NuGet beyond Hello World - DotNext Piter 2017
 
Introduction to Kubernetes and GKE
Introduction to Kubernetes and GKEIntroduction to Kubernetes and GKE
Introduction to Kubernetes and GKE
 
Native client
Native clientNative client
Native client
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
Codetainer: a Docker-based browser code 'sandbox'
Codetainer: a Docker-based browser code 'sandbox'Codetainer: a Docker-based browser code 'sandbox'
Codetainer: a Docker-based browser code 'sandbox'
 
Physical Computing Using Go and Arduino
Physical Computing Using Go and ArduinoPhysical Computing Using Go and Arduino
Physical Computing Using Go and Arduino
 
A DevOps guide to Kubernetes
A DevOps guide to KubernetesA DevOps guide to Kubernetes
A DevOps guide to Kubernetes
 
Google Developer Fest 2010
Google Developer Fest 2010Google Developer Fest 2010
Google Developer Fest 2010
 
Developing your first application using FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWARE
 
JBoss World 2010
JBoss World 2010JBoss World 2010
JBoss World 2010
 

More from KAI CHU CHUNG

Devfest 2023 - Service Weaver Introduction - Taipei.pdf
Devfest 2023 - Service Weaver Introduction - Taipei.pdfDevfest 2023 - Service Weaver Introduction - Taipei.pdf
Devfest 2023 - Service Weaver Introduction - Taipei.pdfKAI CHU CHUNG
 
DevFest 2022 - Skaffold 2 Deep Dive Taipei.pdf
DevFest 2022 - Skaffold 2 Deep Dive Taipei.pdfDevFest 2022 - Skaffold 2 Deep Dive Taipei.pdf
DevFest 2022 - Skaffold 2 Deep Dive Taipei.pdfKAI CHU CHUNG
 
DevFest 2022 - Cloud Workstation Introduction TaiChung
DevFest 2022 - Cloud Workstation Introduction TaiChungDevFest 2022 - Cloud Workstation Introduction TaiChung
DevFest 2022 - Cloud Workstation Introduction TaiChungKAI CHU CHUNG
 
GDG Cloud Taipei: Meetup #52 - Istio Security: API Authorization
GDG Cloud Taipei: Meetup #52 - Istio Security: API AuthorizationGDG Cloud Taipei: Meetup #52 - Istio Security: API Authorization
GDG Cloud Taipei: Meetup #52 - Istio Security: API AuthorizationKAI CHU CHUNG
 
GDG Cloud Taipei meetup #50 - Build go kit microservices at kubernetes with ...
GDG Cloud Taipei meetup #50 - Build go kit microservices at kubernetes  with ...GDG Cloud Taipei meetup #50 - Build go kit microservices at kubernetes  with ...
GDG Cloud Taipei meetup #50 - Build go kit microservices at kubernetes with ...KAI CHU CHUNG
 
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with easeGDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with easeKAI CHU CHUNG
 
Global GDG Leaders Summit, Google I/O 2018 經驗分享
Global GDG Leaders Summit, Google I/O 2018 經驗分享Global GDG Leaders Summit, Google I/O 2018 經驗分享
Global GDG Leaders Summit, Google I/O 2018 經驗分享KAI CHU CHUNG
 
Google apps script introduction
Google apps script introductionGoogle apps script introduction
Google apps script introductionKAI CHU CHUNG
 
Screenshot as a service
Screenshot as a serviceScreenshot as a service
Screenshot as a serviceKAI CHU CHUNG
 
Nas 也可以揀土豆
Nas 也可以揀土豆Nas 也可以揀土豆
Nas 也可以揀土豆KAI CHU CHUNG
 
Django oscar introduction
Django oscar introductionDjango oscar introduction
Django oscar introductionKAI CHU CHUNG
 
Google apps script introduction
Google apps script introductionGoogle apps script introduction
Google apps script introductionKAI CHU CHUNG
 
Gae managed vm introduction
Gae managed vm introductionGae managed vm introduction
Gae managed vm introductionKAI CHU CHUNG
 
Google app engine (gae) 演進史
Google app engine (gae) 演進史Google app engine (gae) 演進史
Google app engine (gae) 演進史KAI CHU CHUNG
 
痞客趴趴走 Waldo
痞客趴趴走   Waldo痞客趴趴走   Waldo
痞客趴趴走 WaldoKAI CHU CHUNG
 
Introduction to chrome extension development
Introduction to chrome extension developmentIntroduction to chrome extension development
Introduction to chrome extension developmentKAI CHU CHUNG
 

More from KAI CHU CHUNG (17)

Devfest 2023 - Service Weaver Introduction - Taipei.pdf
Devfest 2023 - Service Weaver Introduction - Taipei.pdfDevfest 2023 - Service Weaver Introduction - Taipei.pdf
Devfest 2023 - Service Weaver Introduction - Taipei.pdf
 
DevFest 2022 - Skaffold 2 Deep Dive Taipei.pdf
DevFest 2022 - Skaffold 2 Deep Dive Taipei.pdfDevFest 2022 - Skaffold 2 Deep Dive Taipei.pdf
DevFest 2022 - Skaffold 2 Deep Dive Taipei.pdf
 
DevFest 2022 - Cloud Workstation Introduction TaiChung
DevFest 2022 - Cloud Workstation Introduction TaiChungDevFest 2022 - Cloud Workstation Introduction TaiChung
DevFest 2022 - Cloud Workstation Introduction TaiChung
 
GDG Cloud Taipei: Meetup #52 - Istio Security: API Authorization
GDG Cloud Taipei: Meetup #52 - Istio Security: API AuthorizationGDG Cloud Taipei: Meetup #52 - Istio Security: API Authorization
GDG Cloud Taipei: Meetup #52 - Istio Security: API Authorization
 
GDG Cloud Taipei meetup #50 - Build go kit microservices at kubernetes with ...
GDG Cloud Taipei meetup #50 - Build go kit microservices at kubernetes  with ...GDG Cloud Taipei meetup #50 - Build go kit microservices at kubernetes  with ...
GDG Cloud Taipei meetup #50 - Build go kit microservices at kubernetes with ...
 
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with easeGDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
 
Global GDG Leaders Summit, Google I/O 2018 經驗分享
Global GDG Leaders Summit, Google I/O 2018 經驗分享Global GDG Leaders Summit, Google I/O 2018 經驗分享
Global GDG Leaders Summit, Google I/O 2018 經驗分享
 
Google apps script introduction
Google apps script introductionGoogle apps script introduction
Google apps script introduction
 
Screenshot as a service
Screenshot as a serviceScreenshot as a service
Screenshot as a service
 
Nas 也可以揀土豆
Nas 也可以揀土豆Nas 也可以揀土豆
Nas 也可以揀土豆
 
Django oscar introduction
Django oscar introductionDjango oscar introduction
Django oscar introduction
 
Google apps script introduction
Google apps script introductionGoogle apps script introduction
Google apps script introduction
 
Gae managed vm introduction
Gae managed vm introductionGae managed vm introduction
Gae managed vm introduction
 
Google app engine (gae) 演進史
Google app engine (gae) 演進史Google app engine (gae) 演進史
Google app engine (gae) 演進史
 
痞客趴趴走 Waldo
痞客趴趴走   Waldo痞客趴趴走   Waldo
痞客趴趴走 Waldo
 
Waldo-gcp
Waldo-gcpWaldo-gcp
Waldo-gcp
 
Introduction to chrome extension development
Introduction to chrome extension developmentIntroduction to chrome extension development
Introduction to chrome extension development
 

Recently uploaded

Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 

Recently uploaded (20)

Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 

Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (https://youtu.be/eseo0hcRaQI?t=11008)

  • 1. How to debug Microservices on Kubernetes as a pros KAI CHU CHUNG GDGCloud co-organizer GDE(Cloud)
  • 2. “How to debug Microservices on Kubernetes as a pros”
  • 3.
  • 4.
  • 5. 1. Debug 2. Microservice 3. Kubernetes Agenda
  • 7. 1. Local 2. Container 3. Cloud Debugger Debug
  • 8. Local (Golang) func main() { http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { fmt.Fprintf(w, "hello devfest 2020 tw") }) port := os.Getenv("PORT") if port == "" { port = "8080" log.Printf("Defaulting to port %s", port) } log.Printf("Listening on port %s", port) log.Fatal(http.ListenAndServe(fmt.Sprintf(":%s", port), nil)) }
  • 9. Local (Python) from flask import Flask app = Flask(__name__) @app.route('/') def index(): return 'hello devfest 2020 tw' if __name__ == '__main__': app.debug = True app.run()
  • 11. Containers allow you to package your application and its dependencies together into one succinct manifest What are Containers and their benefits | Google Cloud - https://cloud.google.com/containers
  • 13. Dockerfile (Golang) FROM golang:1.15 AS builder WORKDIR /workspace # Install dependencies in go.mod and go.sum COPY go.mod go.sum ./ RUN go mod download # Copy rest of the application source code COPY . ./ # Compile the application to /app. RUN go build -o /exe -v ./ FROM gcr.io/distroless/base:latest COPY --from=builder /exe . ENTRYPOINT ["/exe"]
  • 14. Dockerfile (Golang debug) FROM golang:1.15 # Download the dlv (delve) debugger for go RUN go get -u -v github.com/go-delve/delve/cmd/dlv WORKDIR /workspace # Install dependencies in go.mod and go.sum COPY go.mod go.sum ./ RUN go mod download # Copy rest of the application source code COPY . ./ RUN go build -o /exe -v ./ ENTRYPOINT ["dlv", "exec", "/app", "--continue", "--accept-multiclient", "--api-version=2", "--headless", "--listen=:3000", "--log"]
  • 15. container with known vulnerabilities Source: The state of open source security report 2019 by snyt 44% Google Cloud Next ’20 OnAir - https://cloud.withgoogle.com/next/sf/onair?session=SVR227#application-modernization
  • 16. 1. CNCF sandbox projects 2. suggest builders a. Google b. Heroku c. Paketo Buildpacks Buildpacks
  • 17. Buildpacks Go Cloud Native | Heroku - https://blog.heroku.com/buildpacks-go-cloud-native
  • 18. 1. Open source. 2. Creates secure container images. 3. Designed for running on Cloud Run, GKE, Anthos. Buildpacks GoogleCloudPlatform/buildpacks - https://github.com/GoogleCloudPlatform/buildpacks
  • 19. ● Google Cloud maintains a set of open source buildpacks for building containers to run on GKE, Anthos, & Cloud Run ● Cloud Build native support for buildpacks ● Cloud Run direct source deployments w/ buildpacks ● Cloud Shell has pack pre-installed. App Engine builds via buildpacks ● Cloud Functions builds via buildpacks ● Cloud Code deploy to Cloud Run with Buildpacks ● Skaffold native support for buildpacks Buildpacks on Google Cloud
  • 20. pack build aa --builder gcr.io/buildpacks/builder:v1
  • 21. dive index.docker.io/library/aa:latest wagoodman/dive: A tool for exploring each layer in a docker image - https://github.com/wagoodman/dive
  • 24. Microservices refers to an architectural style for developing applications. Microservices allow a large application to be decomposed into independent constituent parts, with each part having its own realm of responsibility
  • 25. . ├── build ├── cmd ├── deployments ├── internal │ ├── app │ │ ├── authnsvc │ │ ├── authzsvc │ │ ├── docs │ │ ├── emailsvc │ │ ├── invitesvc │ │ ├── mappingsvc │ │ ├── oauthagentsvc │ │ ├── organizationsvc │ │ ├── person_attribute │ │ ├── report_statistics │ │ ├── reportsvc │ │ ├── storesvc │ │ ├── streamsvc │ │ └── ws │ └── pkg ├── pb ├── scripts ├── test ├── cloudbuild-build.yaml ├── cloudbuild-dev-deploy.yaml ├── cloudbuild-dev-meta.yaml ├── cloudbuild-helm.yaml ├── cloudbuild-release-helm.yaml ├── cloudbuild-release-meta.yaml ├── cloudbuild-test.yaml ├── cloudbuild.plantuml ├── makefile └── skaffold.yaml
  • 26. Service Language Description frontend Go Exposes an HTTP server to serve the website. Does not require signup/login and generates session IDs for all users automatically. cartservice C# Stores the items in the user's shopping cart in Redis and retrieves it. productcatalogservice Go Provides the list of products from a JSON file and ability to search products and get individual products. currencyservice Node.js Converts one money amount to another currency. Uses real values fetched from European Central Bank. It's the highest QPS service. paymentservice Node.js Charges the given credit card info (mock) with the given amount and returns a transaction ID. shippingservice Go Gives shipping cost estimates based on the shopping cart. Ships items to the given address (mock) emailservice Python Sends users an order confirmation email (mock). checkoutservice Go Retrieves user cart, prepares order and orchestrates the payment, shipping and the email notification. recommendationservice Python Recommends other products based on what's given in the cart. adservice Java Provides text ads based on given context words. loadgenerator Python/Locust Continuously sends requests imitating realistic user shopping flows to the frontend. GoogleCloudPlatform/microservices-demo - https://github.com/GoogleCloudPlatform/microservices-demo
  • 28. Kubernetes is a portable, extensible, open-source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation. It has a large, rapidly growing ecosystem. Kubernetes services, support, and tools are widely available.
  • 29. 1 2 3 4 5 6 Change code Run docker build Run docker push Patch yaml Run kubectl apply Verify Kubernetes Development workflow
  • 30. Skaffold handles the workflow for building, pushing and deploying your application, allowing you to focus on what matters most: writing code
  • 31.
  • 32. 1. Go (runtime ID: go) 2. NodeJS (runtime ID: nodejs) 3. Java and JVM languages (runtime ID: jvm) 4. Python (runtime ID: python) 5. .NET Core (runtime ID: netcore) Skaffold debug (beta)
  • 33.
  • 34. Cloud Code comes with tools to help you write, run, and debug cloud-native applications quickly and easily.
  • 35. Cloud Code | Google Cloud - https://cloud.google.com/code
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.