This document provides an overview of how to achieve canary deployments on Kubernetes. It begins with background on AWS Elastic Beanstalk and Kubernetes. It then explains blue/green deployments and canary deployments. The remainder of the document demonstrates how to set up canary deployments on Kubernetes using multiple deployments, services, and labels to route a portion of traffic to a new version. It also discusses tools like Helm and Jenkins that can help automate the canary deployment process.
1 of 46
More Related Content
How to Achieve Canary Deployment on Kubernetes
1. How to Achieve Canary
Deployment on Kubernetes
JohnChen
2019/11/30
2. Hello Everyone, My name is John
I was
• a System engineer
• a DevOps
I am
• a Site Reliability Engineer
1
5. Kubernetes (K8s)
• Kubernetes (K8s) is an open-source system for automating
deployment, scaling, and management of containerized applications.
• It groups containers that make up an application into logical units for
easy management and discovery. Kubernetes builds upon 15 years of
experience of running production workloads at Google, combined
with best-of-breed ideas and practices from the community.
4
6. Blue Green Deployment 1/3
• 藍綠部署是版本 B 同等數量的被並排部署在版本A旁邊。
• 當新版本滿足上線條件的測試後,流量在負載均衡層從版本 A 切
換到版本 B。
5
21. Kubernetes canary deployment
You can tweak the number of replicas of the stable and canary releases to determine the ratio of
each release that will receive live production traffic (in this case, 3:1). Once you’re confident, you
can update the stable track to the new application release and remove the canary one.
20
22. Production Pod
metadata.labels:
app. envrionment: preprod
app.service: production
Production Pod
metadata.labels:
app. envrionment: production
app.service: production
Staging Deployment
spec.template.metadata.labels:
app.envrionment: staging
app.service: staging
Preprod Deployment
spec.template.metadata.labels:
app.envrionment: preprod
app.service: production
Production Deployment
spec.template.metadata.labels:
app.envrionment: production
app.service: production
Labels in Service and Deployment
Production Service
selector:
app.service: production
Staging Service
selector:
app.service: staging
Staging Pod
metadata.labels:
app. envrionment: staging
app.service: staging
21
31. Helm
• Helm helps you manage Kubernetes applications.
• Helm Charts help you define, install, and upgrade even the most
complex Kubernetes application.
30
44. Redis Server
6381 port
Redis Server
6379 port
Redis Server
6382 port
Redis Server
6380 port
client-testing-redis.chen.idv
AP 1 AP 2 AP 3 AP 4
EC2
Multi Redis Server in One VM
45. Redis Server
6379 port
Redis Server
6379 port
Redis Server
6379 port
Redis Server
6379 port
AP 1 AP 2 AP 3 AP 4
client-testing-redis.chen.idv:6381
client-testing-redis.chen.idv:6382
client-testing-redis.chen.idv:6379
client-testing-redis.chen.idv:6380
Kubernetes Pod
Kubernetes Service
One Service Connect to Multi Pod 1/2