SlideShare a Scribd company logo
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 Sauce
Jesse 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
 
Rest, sockets em golang
Rest, sockets em golangRest, sockets em golang
Rest, sockets em golang
jefferson Otoni Lima
 
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
Marcus Lönnberg
 
Continuous Integration & Continuous Delivery with GCP
Continuous Integration & Continuous Delivery with GCPContinuous Integration & Continuous Delivery with GCP
Continuous Integration & Continuous Delivery with GCP
KAI CHU CHUNG
 
GraphQL IN Golang
GraphQL IN GolangGraphQL IN Golang
GraphQL IN Golang
Bo-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 2012
Rajmahendra Hegde
 
Introduction to Tekton
Introduction to TektonIntroduction to Tekton
Introduction to Tekton
Victor Iglesias
 
Google App Engine (GAE) 演進史
Google App Engine (GAE) 演進史Google App Engine (GAE) 演進史
Google App Engine (GAE) 演進史
Simon Su
 
Android presentation - Gradle ++
Android presentation - Gradle ++Android presentation - Gradle ++
Android presentation - Gradle ++
Javier de Pedro López
 
Managing dependencies with gradle
Managing dependencies with gradleManaging dependencies with gradle
Managing dependencies with gradle
Liviu Tudor
 
Fabricio - Docker deploy automation
Fabricio - Docker deploy automationFabricio - Docker deploy automation
Fabricio - Docker deploy automation
Rinat Khabibiev
 
Continous delivery with sbt
Continous delivery with sbtContinous delivery with sbt
Continous delivery with sbt
Wojciech Pituła
 
Microservices on Kubernetes - The simple way
Microservices on Kubernetes - The simple wayMicroservices on Kubernetes - The simple way
Microservices on Kubernetes - The simple way
Suraj 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 developer
Paul Czarkowski
 
Containers as a Service with Docker
Containers as a Service with DockerContainers as a Service with Docker
Containers as a Service with Docker
Docker, 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 2016
Patrick 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 Bakker
PROIDEA
 
Import golang; struct microservice
Import golang; struct microserviceImport golang; struct microservice
Import golang; struct microservice
Giulio De Donato
 
Microservices DevOps on Google Cloud Platform
Microservices DevOps on Google Cloud PlatformMicroservices DevOps on Google Cloud Platform
Microservices DevOps on Google Cloud Platform
Sunnyvale
 
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
 
Excelian hyperledger walkthrough-feb17
Excelian hyperledger walkthrough-feb17Excelian hyperledger walkthrough-feb17
Excelian hyperledger walkthrough-feb17
Excelian | Luxoft Financial Services
 
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
Patrick Chanezon
 
Building Web Apps Sanely - EclipseCon 2010
Building Web Apps Sanely - EclipseCon 2010Building Web Apps Sanely - EclipseCon 2010
Building Web Apps Sanely - EclipseCon 2010
Chris 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 2017
Maarten Balliauw
 
Introduction to Kubernetes and GKE
Introduction to Kubernetes and GKEIntroduction to Kubernetes and GKE
Introduction to Kubernetes and GKE
Opsta
 
Native client
Native clientNative client
Native clientzyc901016
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
Paul 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 Arduino
Justin Grammens
 
A DevOps guide to Kubernetes
A DevOps guide to KubernetesA DevOps guide to Kubernetes
A DevOps guide to Kubernetes
Paul 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.pdf
KAI 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.pdf
KAI CHU CHUNG
 
DevFest 2022 - Cloud Workstation Introduction TaiChung
DevFest 2022 - Cloud Workstation Introduction TaiChungDevFest 2022 - Cloud Workstation Introduction TaiChung
DevFest 2022 - Cloud Workstation Introduction TaiChung
KAI 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 Authorization
KAI 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 ease
KAI 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 introduction
KAI CHU CHUNG
 
Screenshot as a service
Screenshot as a serviceScreenshot as a service
Screenshot as a service
KAI CHU CHUNG
 
Nas 也可以揀土豆
Nas 也可以揀土豆Nas 也可以揀土豆
Nas 也可以揀土豆
KAI CHU CHUNG
 
Django oscar introduction
Django oscar introductionDjango oscar introduction
Django oscar introduction
KAI CHU CHUNG
 
Google apps script introduction
Google apps script introductionGoogle apps script introduction
Google apps script introduction
KAI CHU CHUNG
 
Gae managed vm introduction
Gae managed vm introductionGae managed vm introduction
Gae managed vm introduction
KAI CHU CHUNG
 
Google app engine (gae) 演進史
Google app engine (gae) 演進史Google app engine (gae) 演進史
Google app engine (gae) 演進史
KAI CHU CHUNG
 
痞客趴趴走 Waldo
痞客趴趴走   Waldo痞客趴趴走   Waldo
痞客趴趴走 Waldo
KAI CHU CHUNG
 
Waldo-gcp
Waldo-gcpWaldo-gcp
Waldo-gcp
KAI CHU CHUNG
 
Introduction to chrome extension development
Introduction to chrome extension developmentIntroduction to chrome extension development
Introduction to chrome extension development
KAI 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

Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 

Recently uploaded (20)

Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 

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.