SlideShare a Scribd company logo
Technical Manager
William Yeh 葉秉哲 
給 RD 的 Kubernetes 初體驗
… with a series of hands-on labs
2019-08-11
• PhD in Computer Science, NCTU, Taiwan
• CSPO (Certified Scrum Product Owner) from Scrum Alliance
• PSM I (Professional Scrum Master I) from Scrum.org
• Technical manager @ Titansoft (since Mar 2019)
• Server director & Scrum master @ Gogolook
• Active speaker and trainer for software
architecture, DevOps, agile, and theory of
constraints
Containers
Kubernetes
Cloud
Agenda
Containers
Kubernetes
Cloud
Agenda Labs
1.0 — 3.0
4.0 — 5.0
6.0 — 7.0
Agenda
Know promising trends
Adopt gradually
Prepare mindset
Goals
Containers
Kubernetes
Cloud
Labs
1.0 — 3.0
4.0 — 5.0
6.0 — 7.0
GKE Setup🅐
a - Redeem Google Cloud coupon
b - Create project in GCP
c - Create GKE cluster
Redeem coupon
Please follow steps in your handout
NOW!
Create K8s-enabled Project
https://console.cloud.google.com/projectselector2/kuber
netes
Should already done
before you’re here...
Create GKE cluster
gcloud config set project PROJECT_ID
gcloud config set compute/zone us-west1-a
gcloud container clusters create k8s201908 
--num-nodes 3
Lab Setting��
Tag
1.0
2.0
3.0
4.0
5.0
6.0
7.0
Lab material
See the demo first!
Lab material
For each revision, pay attention to:
1. image versions
2. diff in code and configuration
Use git diff --stat HEAD~1 HEAD
to see diff between revisions.
Tag
1.0
2.0
3.0
4.0
5.0
6.0
7.0
Image tags
Lab # Frontend API
1.0 N/A N/A
2.0 N/A 2.0
3.0 3.0 3.0
4.0 3.0 3.0
5.0 5.0 3.0
6.0 auto auto
7.0 auto auto & stable
Lab material
https://github.com/William-Yeh/workshop-k8s201908
or http://bit.ly/k8s-201908 for short
1. Open browser
2. Git clone to your laptop
Containers
1.0 - Legacy
2.0 - Docker
3.0 - Frontend/backend separation
��
Why containers?
Lab # 1.0 Legacy
Lab # 1.0
git checkout 1.0
git log
Lab # 1.0 Review
a. Architecture
b. Main tasks
c. Diff
d. Tricks
e. Questions?
app
runtime
OS kernel
app
runtime
OS kernel
Boundary of application packaging:
pros and cons
traditional deployment way
virtual machine
app
runtime
OS kernel
app
runtime
OS kernel
app
runtime
OS kernel
IaC (Infra as Code)
traditional deployment way
IaC tools
● Chef
● Puppet
● Ansible
virtual machine
app
runtime
OS kernel
app
runtime
OS kernel
app
runtime
OS kernel
Containers as application packaging
units
traditional deployment way
container
virtual machine
Lab # 2.0 Docker
Lab # 2.0
git checkout 2.0
git log
git diff --stat HEAD~1 HEAD
Image tags
Lab # Frontend API
1.0 N/A N/A
2.0 N/A 2.0
3.0 3.0 3.0
4.0 3.0 3.0
5.0 5.0 3.0
6.0 auto auto
7.0 auto auto & stable
Lab # 2.0 Review
a. Architecture
b. Main tasks
c. Diff
d. Tricks
e. Questions?
Lab # 3.0 Frontend/backend separation
Lab # 3.0
git checkout 3.0
git log
git diff --stat HEAD~1 HEAD
Image tags
Lab # Frontend API
1.0 N/A N/A
2.0 N/A 2.0
3.0 3.0 3.0
4.0 3.0 3.0
5.0 5.0 3.0
6.0 auto auto
7.0 auto auto & stable
app
runtime
OS kernel
app
runtime
OS kernel
app
runtime
OS kernel
Recap:
containers as application packaging units
traditional deployment way
container
virtual machine
Lab # 3.0 Review
a. Architecture
b. Main tasks
c. Diff
d. Tricks
e. Questions?
Kubernetes
4.0 - Local Kubernetes
5.0 - Configuration
��
https://kubernetes.io/
Lab # 4.0 Local Kubernetes
Lab # 4.0
git checkout 4.0
git log
git diff --stat HEAD~1 HEAD
Image tags
Lab # Frontend API
1.0 N/A N/A
2.0 N/A 2.0
3.0 3.0 3.0
4.0 3.0 3.0
5.0 5.0 3.0
6.0 auto auto
7.0 auto auto & stable
Concept gaps
from Docker to Kubernetes
Container
Service
container
service
pod
deployment 3
container
service
.
.
.
└── k8s
├── todoapi-service.yml
└── todofrontend-service.yml
Service
Service
container
service
pod
deployment
---
kind: Service
...
---
kind: Deployment
...
spec:
replicas: 3
template: # pod definition
spec:
containers:
- name: todoapi
image: todoapi:3.0
k8s/todoapi-service.yml
service
deployment
---
kind: Service
...
---
kind: Deployment
...
spec:
replicas: 3
template: # pod definition
spec:
containers:
- name: todoapi
image: todoapi:3.0
k8s/todoapi-service.yml
container
pod
---
kind: Service
...
---
kind: Deployment
...
spec:
replicas: 3
template: # pod definition
spec:
containers:
- name: todoapi
image: todoapi:3.0
Container
Pod
Container
Any examples?
• Shared volumes
• IPC
• Network
Multi-Container Pods in Kubernetes
Pod
Container
Multi-container pods and container communication in Kubernetes
https://www.mirantis.com/blog/multi-container-pods-and-container-communication-in-kubernetes/
Deployment & Replica
3
pod
---
kind: Service
...
---
kind: Deployment
...
spec:
replicas: 3
template: # pod definition
spec:
containers:
- name: todoapi
image: todoapi:3.0
deployment
Selector & label
3
The selector field defines
how the Deployment finds
which Pods to manage.
label
selector
service
deployment
---
kind: Service
...
---
kind: Deployment
...
spec:
replicas: 3
template: # pod definition
spec:
containers:
- name: todoapi
image: todoapi:3.0
Service
label
selector
3
---
kind: Service
...
---
kind: Deployment
...
spec:
replicas: 3
template: # pod definition
spec:
containers:
- name: todoapi
image: todoapi:3.0
Recap
Service
container
pod
deployment
service
3
Service
container
service
pod
deployment
---
kind: Service
...
---
kind: Deployment
...
spec:
replicas: 3
template: # pod definition
spec:
containers:
- name: todoapi
image: todoapi:3.0
k8s/todoapi-service.yml
pod
---
kind: Service
...
---
kind: Deployment
...
spec:
replicas: 3
template: # pod definition
spec:
containers:
- name: todoapi
image: todoapi:3.0
deployment
service
container
Kubernetes
Terminology
Learn by doing!
Make sure you’re using local Kubernetes
kubectl config view
kubectl config get-contexts
kubectl config use-context docker-for-desktop
or
kubectl config use-context minikube
How to use kubectl to manage multiple Kubernetes clusters
https://success.docker.com/article/how-to-use-kubectl-to-manage-multiple-kubernetes-clusters
Lab # 4.0 Review
a. Architecture
b. Main tasks
c. Diff
d. Tricks
e. Questions?
CAUTION
● There’s one big issue in this Lab 4.0
Can you see?
● What if a image changes
but version tag remains unchanged?
Lab # 5.0 Configuration
Lab # 5.0
git checkout 5.0
git log
git diff --stat HEAD~1 HEAD
Image tags
Lab # Frontend API
1.0 N/A N/A
2.0 N/A 2.0
3.0 3.0 3.0
4.0 3.0 3.0
5.0 5.0 3.0
6.0 auto auto
7.0 auto auto & stable
_v2
Service
container
pod
deployment
service
Recap:
containers as application packaging units
3
Lab # 5.0 Review
a. Architecture
b. Main tasks
c. Diff
d. Tricks
e. Questions?
Cloud
6.0 - Cloud (GKE for example)
7.0 - Canary release
��
Lab # 6.0 Cloud (GKE for example)
Lab # 6.0
git checkout 6.0
git log
git diff --stat HEAD~1 HEAD
Image tags
Lab # Frontend API
1.0 N/A N/A
2.0 N/A 2.0
3.0 3.0 3.0
4.0 3.0 3.0
5.0 5.0 3.0
6.0 auto auto
7.0 auto auto & stable
Local/cloud diff -
k8s/***/config.***.yml
Local/cloud diff -
k8s/***/todoapi-service.yml
Local/cloud diff -
k8s/***/todoapi-service.yml
Local/cloud diff -
k8s/***/todofrontend-service.yml
Local/cloud diff -
k8s/***/todofrontend-service.yml
Skaffold
skaffold.yaml
cloud
local
Lab # 6.0 Review
a. Architecture
b. Main tasks
c. Diff
d. Tricks
e. Questions?
Lab # 7.0 Canary release
Lab # 7.0
git checkout 7.0
git log
git diff --stat HEAD~1 HEAD
Image tags
Lab # Frontend API
1.0 N/A N/A
2.0 N/A 2.0
3.0 3.0 3.0
4.0 3.0 3.0
5.0 5.0 3.0
6.0 auto auto
7.0 auto auto & stable
_v2
1
stable autoimage tag:
3
Stable/canary diff -
k8s/***/todoapi-***.yml
_v2
Service
label
label
1
selector
stable autoimage tag:
3
Lab # 7.0 Review
a. Architecture
b. Main tasks
c. Diff
d. Tricks
e. Questions?
Conclusion��
app
runtime
OS kernel
app
runtime
OS kernel
app
runtime
OS kernel
Recap:
containers as application packaging units
traditional deployment way
container
virtual machine
_v2
Service
container
pod
deployment
service
label
label
3
selector
Agenda
Know promising trends
Adopt gradually
Prepare mindset
Goals
Containers
Kubernetes
Cloud
Labs
1.0 — 3.0
4.0 — 5.0
6.0 — 7.0
Kubernetes
Terminology
“Kubernetes 101: Pods, Nodes, Containers,
and Clusters”
• Author: Daniel Sanche
• Date: 2018-01-02
• URL:
https://medium.com/google-cloud/kubernetes-101-pods-nodes-c
ontainers-and-clusters-c1509e409e16
(or http://bit.ly/post-k8s-101 for short)
Not told today
Session affinity
https://medium.com/@diegomrtnzg/redirect-your-users-to-the-same-pod
-by-using-session-affinity-on-kubernetes-baebf6a1733b
StatefulSet
https://godleon.github.io/blog/Kubernetes/k8s-StatefulSets-Overview
/
Persistent Volume & Claim
https://godleon.github.io/blog/Kubernetes/k8s-PersistentVolume-Over
view/
Next step?
https://www.udemy.com/course/certified-kubernetes-application-developer/
Questions?
Attribution
● review by Alina Oleynik from the Noun Project

More Related Content

PDF
gRPC:更高效的微服務介面
PDF
賣 K8s 的人不敢告訴你的事 (Secrets that K8s vendors won't tell you)
PDF
給 RD 的 Kubernetes 初體驗
PDF
給 RD 的 Kubernetes 初體驗 (gcpug 2019-06 version)
PDF
Next ’19 的 Istio 場次 重點摘要
PDF
給 RD 的 Kubernetes 初體驗 (EKS version)
PDF
Crossing the Streams! Rollout Strategies to Keep Your Users Happy!
PDF
A GitOps Kubernetes Native CICD Solution with Argo Events, Workflows, and CD
gRPC:更高效的微服務介面
賣 K8s 的人不敢告訴你的事 (Secrets that K8s vendors won't tell you)
給 RD 的 Kubernetes 初體驗
給 RD 的 Kubernetes 初體驗 (gcpug 2019-06 version)
Next ’19 的 Istio 場次 重點摘要
給 RD 的 Kubernetes 初體驗 (EKS version)
Crossing the Streams! Rollout Strategies to Keep Your Users Happy!
A GitOps Kubernetes Native CICD Solution with Argo Events, Workflows, and CD

What's hot (20)

PDF
Argocd up and running
PDF
Devoxx 17 - Real Time Code Coverage
PDF
Hands-on GitOps Patterns for Helm Users
PDF
Continuous Delivery NYC: From GitOps to an adaptable CI/CD Pattern for Kubern...
PDF
Visual Studio로 Kubernetes 사용하기
PDF
Terraform GitOps on Codefresh
PDF
Free GitOps Workshop + Intro to Kubernetes & GitOps
PDF
DevOps: The Future of Software Development
PDF
How to Become DevOps
PDF
Observe and command your fleets across any kubernetes with weave git ops
PDF
JS Fest 2019. Peter Braun. DevOps in the Cluster: A deep dive into operators
PDF
How we can do Multi-Tenancy on Kubernetes
PDF
Gitlab ci, cncf.sk
PDF
The Power of GitOps with Flux & GitOps Toolkit
PDF
Ambassador Developer Office Hours: Summer of Kubernetes Ship Week 1: Intro to...
PDF
猿でもわかる Helm
PDF
Workshop Azure DevOps Repos
PDF
4K–Kubernetes with Knative, Kafka and Kamel
PDF
Exploring the GitHub Service Universe
PDF
DevOps Spain 2019. Jaime Balañá-NetApp
Argocd up and running
Devoxx 17 - Real Time Code Coverage
Hands-on GitOps Patterns for Helm Users
Continuous Delivery NYC: From GitOps to an adaptable CI/CD Pattern for Kubern...
Visual Studio로 Kubernetes 사용하기
Terraform GitOps on Codefresh
Free GitOps Workshop + Intro to Kubernetes & GitOps
DevOps: The Future of Software Development
How to Become DevOps
Observe and command your fleets across any kubernetes with weave git ops
JS Fest 2019. Peter Braun. DevOps in the Cluster: A deep dive into operators
How we can do Multi-Tenancy on Kubernetes
Gitlab ci, cncf.sk
The Power of GitOps with Flux & GitOps Toolkit
Ambassador Developer Office Hours: Summer of Kubernetes Ship Week 1: Intro to...
猿でもわかる Helm
Workshop Azure DevOps Repos
4K–Kubernetes with Knative, Kafka and Kamel
Exploring the GitHub Service Universe
DevOps Spain 2019. Jaime Balañá-NetApp
Ad

Similar to 給 RD 的 Kubernetes 初體驗 (GDG Cloud KH 2019-08 version) (20)

PPTX
Use GitLab with Chaos Engineering to Harden your Applications + OpenEBS 1.3 ...
PDF
Gitlab ci e kubernetes, build test and deploy your projects like a pro
PDF
DCSF 19 Kubernetes and Container Storage Interface Update
PDF
KubeCon EU 2022 Istio, Flux & Flagger.pdf
PDF
GitOps: Git come unica fonte di verità per applicazioni e infrastruttura
PDF
Kubernetes GitOps featuring GitHub, Kustomize and ArgoCD
PDF
GitOps Testing in Kubernetes with Flux and Testkube.pdf
PDF
Open Discussion: Nephio Test-infra project
PDF
A Love Story with Kubevirt and Backstage from Cloud Native NoVA meetup Feb 2024
PDF
Hybrid and Multi-Cloud Strategies for Kubernetes with GitOps
PDF
Hybrid and Multi-Cloud Strategies for Kubernetes with GitOps
PDF
IBM Cloud Bordeaux Meetup - 20190325 - Software Factory
PPTX
[Devopsdays2021] Roll Your Product with Kaizen Culture
PPTX
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
PDF
AZ-400 Exam Dumps Online – Proven by Learners Worldwide
PPTX
[20200720]cloud native develoment - Nelson Lin
PDF
DevOps-Ebook
PDF
CICD_BestPractices.pdf
PDF
GitOps Cookbook (Third Early Release) Natale Vinto
PPTX
JOIN 2022: Patching 3rd party software Like a boss
Use GitLab with Chaos Engineering to Harden your Applications + OpenEBS 1.3 ...
Gitlab ci e kubernetes, build test and deploy your projects like a pro
DCSF 19 Kubernetes and Container Storage Interface Update
KubeCon EU 2022 Istio, Flux & Flagger.pdf
GitOps: Git come unica fonte di verità per applicazioni e infrastruttura
Kubernetes GitOps featuring GitHub, Kustomize and ArgoCD
GitOps Testing in Kubernetes with Flux and Testkube.pdf
Open Discussion: Nephio Test-infra project
A Love Story with Kubevirt and Backstage from Cloud Native NoVA meetup Feb 2024
Hybrid and Multi-Cloud Strategies for Kubernetes with GitOps
Hybrid and Multi-Cloud Strategies for Kubernetes with GitOps
IBM Cloud Bordeaux Meetup - 20190325 - Software Factory
[Devopsdays2021] Roll Your Product with Kaizen Culture
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
AZ-400 Exam Dumps Online – Proven by Learners Worldwide
[20200720]cloud native develoment - Nelson Lin
DevOps-Ebook
CICD_BestPractices.pdf
GitOps Cookbook (Third Early Release) Natale Vinto
JOIN 2022: Patching 3rd party software Like a boss
Ad

More from William Yeh (20)

PDF
敏捷轉型:目標管理工作坊
PDF
當 .NET 遇到 Kubernetes (When .NET meets Kubernetes)
PDF
為了精準估算,你必須付出什麼代價?
PDF
從限制理論角度談敏捷導入階段 (Agile transition: a TOC perspective)
PDF
從系統思考看 DevOps:以 microservices 為例 (DevOps: a system dynamics perspective)
PDF
DevOps to Agile 敏捷轉型經驗  (From DevOps to Agile: Transformation Experience of G...
PDF
軟體雲端化的要素 (Elements of Cloud-Native Apps)
PDF
瓶頸處理九大原則 (精簡版)
PDF
Docker 導入:障礙與對策
PDF
Monitoring 改造計畫:流程觀點
PDF
從限制理論看 DevOps
PDF
有了 Agile,為什麼還要有 DevOps?
PDF
Docker 對傳統 DevOps 工具鏈的衝擊 (Docker's Impact on traditional DevOps toolchain)
PDF
Immutable infrastructure:觀念與實作 (建議)
PDF
Ansible 實戰:top down 觀點
PDF
Whoscall 的 Realtime Monitoring 經驗分享
PDF
A gentle introduction to Ansible
PDF
12 Factor App from Docker's Point of View
PPT
On MongoDB backup
PPT
State machine 應用簡介(兼談 UML 2)
敏捷轉型:目標管理工作坊
當 .NET 遇到 Kubernetes (When .NET meets Kubernetes)
為了精準估算,你必須付出什麼代價?
從限制理論角度談敏捷導入階段 (Agile transition: a TOC perspective)
從系統思考看 DevOps:以 microservices 為例 (DevOps: a system dynamics perspective)
DevOps to Agile 敏捷轉型經驗  (From DevOps to Agile: Transformation Experience of G...
軟體雲端化的要素 (Elements of Cloud-Native Apps)
瓶頸處理九大原則 (精簡版)
Docker 導入:障礙與對策
Monitoring 改造計畫:流程觀點
從限制理論看 DevOps
有了 Agile,為什麼還要有 DevOps?
Docker 對傳統 DevOps 工具鏈的衝擊 (Docker's Impact on traditional DevOps toolchain)
Immutable infrastructure:觀念與實作 (建議)
Ansible 實戰:top down 觀點
Whoscall 的 Realtime Monitoring 經驗分享
A gentle introduction to Ansible
12 Factor App from Docker's Point of View
On MongoDB backup
State machine 應用簡介(兼談 UML 2)

Recently uploaded (20)

PPTX
A Presentation on Artificial Intelligence
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
KodekX | Application Modernization Development
PDF
Electronic commerce courselecture one. Pdf
PPT
Teaching material agriculture food technology
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
Cloud computing and distributed systems.
PPTX
Big Data Technologies - Introduction.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Encapsulation_ Review paper, used for researhc scholars
A Presentation on Artificial Intelligence
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Advanced methodologies resolving dimensionality complications for autism neur...
20250228 LYD VKU AI Blended-Learning.pptx
The AUB Centre for AI in Media Proposal.docx
KodekX | Application Modernization Development
Electronic commerce courselecture one. Pdf
Teaching material agriculture food technology
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Cloud computing and distributed systems.
Big Data Technologies - Introduction.pptx
Machine learning based COVID-19 study performance prediction
NewMind AI Weekly Chronicles - August'25 Week I
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Spectral efficient network and resource selection model in 5G networks
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Per capita expenditure prediction using model stacking based on satellite ima...
Encapsulation_ Review paper, used for researhc scholars

給 RD 的 Kubernetes 初體驗 (GDG Cloud KH 2019-08 version)