Canary Deployment Using Kubernetes Primitives 1670176779
Canary Deployment Using Kubernetes Primitives 1670176779
Canary Deployment Using Kubernetes Primitives 1670176779
@jakubkrzywda
How to perform a
CANARY DEPLOYMENT
using only Kubernetes
Primitives?
Canary deployment refers to testing a new
version of application with real users in a live
production environment.
replicas: 3
...
labels:
app: myapp
track: stable
image: myapp:v1
Create Initial Deployment
1.
replicas: 3
...
labels:
app: myapp
track: stable
image: myapp:v1
Expose it with a Service
2.
name: myservice
selector:
app: myapp
replicas: 3
...
labels:
app: myapp
track: stable
image: myapp:v1
Expose it with a Service
2.
name: myservice
selector:
app: myapp
replicas: 3
...
labels:
app: myapp
track: stable
image: myapp:v1
Add an Ingress
3.
backend:
service: myservice
name: myservice
selector:
app: myapp
replicas: 3
...
labels:
app: myapp
track: stable
image: myapp:v1
Add an Ingress
3.
backend:
service: myservice
Ingress is optional
but useful to
expose application
name: myservice
outside the cluster. selector:
app: myapp
replicas: 3
...
labels:
app: myapp
track: stable
image: myapp:v1
Add Canary Deployment
4.
backend:
service: myservice
name: myservice
selector:
app: myapp
replicas: 3 replicas: 1
... ...
labels: labels:
app: myapp app: myapp
track: stable track: canary
image: myapp:v1 image: myapp:v2
Add Canary Deployment
4.
backend:
service: myservice
Notice differences in
the number of replicas,
values of track label
and image tags. name: myservice
selector:
Canary will handle 25% app: myapp
of incoming workload.
replicas: 3 replicas: 1
... ...
labels: labels:
app: myapp app: myapp
track: stable track: canary
image: myapp:v1 image: myapp:v2
JAKUB KRZYWDA
@jakubkrzywda