SlideShare a Scribd company logo
Something About . . .
Operation/Maintenance
Kubernetes
Hello!
I am Tom Tsai aka smalltown
2
“
3
http://bit.ly/taipei-hug
“ Kubernetes
Production
4
Outline
◂
◂
◂
◂
◂
◂
◂
◂
5
1.
Where is Your
Kubernetes?
Select Where Your Kubernetes is!
7
Public Cloud
No
Yes
Completed
Network Infra.
General Usage
Yes
Yes
No
Shutdown
Suddenly
No Yes
No
When Should I Self-Hosted Kubernetes
◂
◂
◂
8
1.
High
Availability/Scalability
High Availability: Kubernetes Itself
10
- Key/Value Storage - apiserver
- scheduler
- controller-manager
- kubelet
- kube-proxy
- container runtime- HA: 1, 3, 5 …
- Clustering Guide
- General HA Mode
High Availability: Application in K8S
◂
11
~$ kubectl get deployment
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
Nginx 3 3 3 3 18s
Before Talk About
Scalability . . .
12
K8S Resource Request & Limit
13
Ref
Scalability: Horizontal Pod Autoscaler
14
Ref
Scalability: Vertical Pods Autoscaler
15
Ref
Scalability: Cluster Autoscaler
16
Ref
1.
Manage
Stateful Service
Stateful Service
◂
◂
◂
◂
◂
◂
18
Manage Production Service
19
Stateless Stateful
Setup
Scale Out/Up
Backup
Upgrade
Operation
CoreOS Brings
K8S Operator . . .
20
What is Kubernetes Operator?
◂
◂
◂
21
What is Kubernetes Operator?
22
An Operator is a Domain Specific Controller
Operation of Stateless Service
23
kubectl
ReplicaSet
app=web, env=prod
Pod
app=web
env=prod
scale up
desired=3 count=1
kubectl
ReplicaSet
app=web, env=prod
Pod
app=web
env=prod
desired=3 count=3
Operation of Stateful Service
(Operator)
24
backup
kubectl
etcd Operator
app=3.0.13
size=3
Pod
app=web
env=prod
backup-tool
interval=300s
Exist Operators
◂
◂
25
1.
Log/Monitoring
Log Management
. . .
27
Log Management: Yes, ELKF
◂
◂
◂
28
Log Collect
Centralised V.S. Decentralised
◂
◂
◂
29
System/Application
Metric Collect . . .
30
Metrics: Yes, Prometheus
◂
31
Get Alert When
Service . . .
32
Monitoring: Internal
◂
◂
33
Ref
Monitor: External
◂
◂
◂
◂
34
1.
Continuous Delivery
Common Resource View of K8S Application
36
Deployment YAML
ConfigMap YAML Secret YAML/VaultDocker Image Tag
Service YAML
Deploy With kubectl
37
Ref
The Key Man: Helm
◂
◂
◂
38
Deploy With Helm
39
Ref
Good Old Days V.S. Kubernetes
40
GNU/Linux
ELF Binaries Config in /etc
apt, yum, etc
Chef, Puppet, Ansible
Kubernetes
Images K8S Object
Helm
Operator Framework
CI/CD Total Solution For K8S
◂
◂
◂
◂
◂
41
GitOps Patterns
42
Ref
1.
TroubleShooting
Guide
Official TroubleShooting Guide
◂
◂
◂
◂
44
Just My Two Cents: Pod
◂ Pending
◂ Terminating
◂ CrashLoopBackOff
45
Just My Two Cents: Service
◂ Endpoint is Empty
◂
◂
◂
46
Just My Two Cents: Node Register
◂
◂
◂
◂
47
1.
Your Best
Friend: kubectl
Good Craftsmanship Depends
on Use of The Right Tools
When You Manage N Clusters N
Namespaces
◂
◂
◂
◂
◂
49
There Are Several Helper Tool For You
◂
◂
◂
◂
50
Ref
1.
Kubernetes
Trends
Where Kubernetes is Going?
Kubernetes Move So Fast...
◂
◂
◂
◂
52
53
Thanks!
Any questions?
◂

More Related Content

維運Kubernetes的兩三事