![Page 1: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/1.jpg)
Continuous Delivery of Micro services with Kubernetes
27-2-2017 – Quintor
![Page 2: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/2.jpg)
Bedankt voor jullie aandacht
“Once you stop learning, you start dying”- Albert Einstein
ARJEN WASSINKPrincipal Consultant
@ArjenWassink
![Page 3: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/3.jpg)
The Menu1. Intro Microservices2. Intro Docker3. Kubernetes4. Rolling updates5. Persisted volumes6. Stateful services
![Page 4: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/4.jpg)
Martin Fowler on Microservices:
In short, the microservice architectural style [1] is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API. These services are built around business capabilities and independently deployable by fully automated deployment machinery. There is a bare minimum of centralized management of these services, which may be written in different programming languages and use different data storage technologies.
![Page 5: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/5.jpg)
Microservices: Scaling is important
https://www.nginx.com/blog/introduction-to-microservices/
![Page 6: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/6.jpg)
Microservices: advantages● The services themselves are very simple, focussing on doing
one thing well;● Each service can be built using the best and most appropriate
tool for the job;● Systems built in this way are inherently loosely coupled;● Multiple developers and teams can deliver relatively
independently of each other under this model;● They are a great enabler for continuous delivery, allowing
frequent releases whilst keeping the rest of the system available and stable.
![Page 7: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/7.jpg)
Microservices: drawbacks
● Diverse technology stack ● Complex distributed systems● More software projects to manage● Reliability and performance● Exponentially more service instances to manage
![Page 8: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/8.jpg)
Build Ship Run
![Page 9: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/9.jpg)
http://www.zdnet.com/article/what-is-docker-and-why-is-it-so-darn-popular/
Virtual Machines vs. Containers
![Page 10: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/10.jpg)
Docker - Layering
https://docs.docker.com/engine/userguide/storagedriver/imagesandcontainers/
![Page 11: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/11.jpg)
https://docs.docker.com/engine/introduction/understanding-docker/
Docker - Architecture
![Page 12: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/12.jpg)
Microservices: drawbacks
● Diverse technology stack○ Containerization freedom of technology choice○ Uniform way of distributing and running apps
● Complex distributed systems● More software projects to manage● Reliability and performance● Exponentially more service instances to manage
![Page 13: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/13.jpg)
Docker at scale with Kubernetes
![Page 14: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/14.jpg)
Everything at Google runs in containers
Launch over 2 billion containers per week.
![Page 15: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/15.jpg)
Enter Kubernetes
Greek for “Helmsman”; also the root of the word “Governor”
• Container orchestrator
• Runs containers
• Supports multiple cloud and bare-metal environments
• Inspired and informed by Google’s experiences and internal systems
• Open source, written in Go
Manage applications, not machines
![Page 16: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/16.jpg)
web browsers
Scheduler
kubectl web browsers
scheduler
Kubelet Kubelet Kubelet Kubelet
Config file
Kubernetes Master
Container Image
Developer View
What justhappened?
![Page 17: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/17.jpg)
Pods, Replication sets & scaling
Pod
con-tainer
con-tainer
Deployment
Replication Set
Pod
con-tainer
con-tainer
Pod
con-tainer
con-tainer
![Page 18: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/18.jpg)
Kubernetes - Architecture
https://en.wikipedia.org/wiki/Kubernetes
![Page 19: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/19.jpg)
Worker Node
192.168.178.200
10.1.2.0/24
Worker Node
192.168.178.100
10.1.1.0/24
Cluster networking
Pod
10.1.1.21
Pod
10.1.1.22
Pod
10.1.1.20
Pod
10.1.2.31
Pod
10.1.2.32
Pod
10.1.2.30
![Page 20: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/20.jpg)
Services
Pod
con-tainer
con-tainer
Service
Cluster IP:port <10.0.0.20:80>Node IP:port <10.150.42.191:88>
Pod
con-tainer
con-tainer
Pod
con-tainer
con-tainer
Loadbalancer
Kube Proxy
(IP Tables)
API server
Watches
![Page 21: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/21.jpg)
Worker Node
Persistent Storage Node
Persistent VolumesPod
con-tainer
con-tainer
Persisted Volume
Persisted Volume ClaimPersisted Volume Mount
![Page 22: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/22.jpg)
![Page 23: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/23.jpg)
Microservices: drawbacks
● Diverse technology stack● Complex distributed systems
○ Service discovery helps● More software projects to manage● Reliability and performance
○ Manages availability actively● Exponentially more service instances to manage
○ Manage instances from code
![Page 24: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/24.jpg)
Stateful Set
Pod-1
con-tainer
con-tainer
Statefull Set Pod-0
con-tainer
con-tainer
Pod-2
con-tainer
con-tainer
Service
![Page 25: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/25.jpg)
Quintor
Deploying without downtime
• Rolling updates• Rollback• Readiness Probes
![Page 26: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/26.jpg)
Worker Node
Namespaces
PodDeployment Pod
Service
PodDeployment Pod
Service
Worker Node
![Page 27: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/27.jpg)
Kubernetes - Centralized Logging
![Page 28: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/28.jpg)
Kubernetes - Centralized Monitoring
![Page 29: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/29.jpg)
![Page 30: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/30.jpg)
Microservices: drawbacks
● Diverse technology stack● Complex distributed systems● More software projects to manage
○ Namespaces enables multiple projects● Reliability and performance
○ Stateful Sets enables persistence clusters○ Active health monitoring and resource limiting
● Exponentially more service instances to manage○ Centralized monitoring and logging
![Page 31: Continuous delivery of microservices with kubernetes - Quintor 27-2-2017](https://reader031.vdocuments.us/reader031/viewer/2022021920/58ce7e2d1a28ab210a8b4f43/html5/thumbnails/31.jpg)
Quintor
Resources
• Docker - Build, Ship, and Run Any App, Anywhere – www.docker.com• Kubernetes - Accelerate Your Delivery – kubernetes.io• Creating a Raspberry Pi cluster running Kubernetes –
tinyurl.com/rpi-k8s-cluster
@ArjenWassink