2. Copyright 2017 ITRI ⼯工業技術研究院
Agenda
• Kubernetes Introduction
• Scaling and Upgrading with K8S
• Hands ON (Demo)
• Q & A
2
3. Copyright 2017 ITRI ⼯工業技術研究院
OpenStack Summit 2017
Will Kubernetes Steal the Show?
• Before the summit:
▪ OpenStack on Kubernetes?
▪ Kubernetes on OpenStack?
▪ How about Kubernetes on OpenStack on Kubernetes?
• The list of breakaway sessions
▪ Kubernetes and OpenStack at Scale.
▪ OpenDaylight Kubernetes & OpenStack Magnum integration.
▪ ESCaaS 4.0, Unified Management Platform of OpenStack and Kubernetes.
▪ Hybrid Cloud Kubernetes.
▪ Hybrid Orchestration: Kubernetes on Bare Metal and OpenStack Demo.
▪ Panel: Enterprise Adoption of Kubernetes and Containers.
https://thenewstack.io/openstack-summit-2017-will-kubernetes-stealing-show/
3
4. Copyright 2017 ITRI ⼯工業技術研究院
What’s Kubernetes
• “Kubernetes” is Greek for captain or pilot
• Experiences from Google and design by Goolge
• Kubernetes is a production-grade, open-source platform that
orchestrates the placement (scheduling) and execution of
application containers within and across computer clusters.
• Masters manage the cluster and the nodes are used to host the
running applications.
4
5. Copyright 2017 ITRI ⼯工業技術研究院
Why Kubernetes
5
• Automatic binpacking
• Horizontal scaling
• Automated rollouts and rollback
• Service monitoring
• Self-healing
• Service discovery and load balancing
• 100% Open source, written in Go
7. Copyright 2017 ITRI ⼯工業技術研究院
Kubernetes 1.6 Scalability Update
5,000 node and 150,000 pod clusters
7
8. Copyright 2017 ITRI ⼯工業技術研究院
Kubernetes 1.6 Scalability Update (cont.)
API response latency for a
5000-node Kubernetes 1.6
cluster are less than 500ms,
and even 90th percentile is
less than about 100ms
8
12. Copyright 2017 ITRI ⼯工業技術研究院
etcd
• Distributed key, value store
• Used for configuration and monitoring store
• Used for Service discovery
• JSON/REST API
12
13. Copyright 2017 ITRI ⼯工業技術研究院
flannel
• A virtual network that
gives a subnet to
each host for use with
container runtimes
13
14. Copyright 2017 ITRI ⼯工業技術研究院
The Key Concept
• Pod
• Smallest deployable unit
• Shared context
• Service
• Targets pods
• Long-lived
• Deployment (Replication
controller)
• Ensure N pods are running
• Pod template
• Label
• Key/value pair
• Organize, select objects
• Kubernetes
14
15. Copyright 2017 ITRI ⼯工業技術研究院
Nodes
• A node is a worker machine in
Kubernetes and may be a VM
or physical machine
• Multiple Pods can run on one
Node
15
16. Copyright 2017 ITRI ⼯工業技術研究院
Pods
• A group of one or more containers
• Containers within a pod share IP, port, namespaces and
volumes.
16
17. Copyright 2017 ITRI ⼯工業技術研究院
Service
• Persistent
• Routes traffic across a set of
Pods
• Provide load balancer
• Provide discovery
• Provide stable service address
• Find pods by label selector
A Service is an abstraction
which defines a logical set of
Pods and a policy by which to
access them
17
18. Copyright 2017 ITRI ⼯工業技術研究院
Label
• Metadata with semantic
meaning
• Label selector
• Set of objects
18
19. Copyright 2017 ITRI ⼯工業技術研究院
Namespace
• Group + segment pods, rcs, volumes and secrets from each other
https://www.slideshare.net/imesh/multitenancy-in-c5
19
20. Copyright 2017 ITRI ⼯工業技術研究院
Deployment (Replication Controller)
• Provides declarative updates for Pods and ReplicaSets
• Rollout/ Roll back a ReplicaSet
• Scale up the deployment
20
21. Copyright 2017 ITRI ⼯工業技術研究院
Deployment
Deployment
Replica Set
Replica Set
Replica Set Replica Set
Pod Pod
Pod Pod Recommend using
Deployments instead of
directly using
ReplicaSets
21
22. Copyright 2017 ITRI ⼯工業技術研究院
Deployment (cont.)
• A Deployment provides declarative updates
for Pods and ReplicaSets
• Typical use case
▪ Create a Deployment to rollout a ReplicaSet
▪ Rollback to an earlier Deployment revision
▪ Scale up the Deployment to facilitate more load
▪ Use the status of the Deployment as an indicator that a rollout has stuck
▪ Clean up older ReplicaSets that you don’t need anymore
22
23. Copyright 2017 ITRI ⼯工業技術研究院
Scaling
Scaling is accomplished
by changing the number
of replicas in a
Deployment
23
25. Copyright 2017 ITRI ⼯工業技術研究院
Horizontal Pod Autoscaling
• Automatically scales the number
of pods in a replication controller,
deployment or replica set based
on observed CPU utilization
• Operates within user-defined min/
max bounds
• Set it and forget it
https://www.slideshare.net/DanielSmith272/whats-new-in-kubernetes
25
29. Copyright 2017 ITRI ⼯工業技術研究院
Rolling updates
Rolling updates allow Deployments'
update to take place with zero
downtime by incrementally updating
Pods instances with new ones.
29
30. Copyright 2017 ITRI ⼯工業技術研究院
Rolling updates (cont.)
If a Deployment is exposed
publicly, the Service will load-
balance the traffic only to
available Pods during the update.
30
33. Copyright 2017 ITRI ⼯工業技術研究院
Rolling updates (cont.)
• Allow the following actions:
▪ Promote an application from one environment to another (via container
image updates)
▪ Rollback to previous versions
▪ Continuous Integration and Continuous Delivery of applications with zero
downtime
33