Progressive Delivery in the Kubernetes Era
Alex Soto Bueno
@alexsotob
Progressive Delivery in the Kubernetes Era
Alex Soto (@alexsotob)
Who am I ?
3
Today’s Objectives
Progressive Delivery
Delivery Techniques
Kubernetes
Let’s Wind Down
@alexsotob
@alexsotob
Why?
5
“ Your code is only valuable when is in production. Production is the best place to be.
Not here
@alexsotob
@alexsotob
Progressive Delivery
@alexsotob
@alexsotob
What is Progressive Delivery?
Build
Test
Security Checks
Release
Deploy�Stage
Deploy�Prod
Continuous Integration
Continuous Delivery
@alexsotob
@alexsotob
8
@alexsotob
@alexsotob
9
@alexsotob
@alexsotob
10
@alexsotob
@alexsotob
11
@alexsotob
@alexsotob
12
@alexsotob
@alexsotob
What is Progressive Delivery?
@alexsotob
@alexsotob
Why Progressive Delivery?
@alexsotob
@alexsotob
Delivery Techniques
@alexsotob
@alexsotob
16
@alexsotob
@alexsotob
Blue Green Deployment
17
@alexsotob
@alexsotob
Canary Releases
18
@alexsotob
@alexsotob
Dark Launches
19
@alexsotob
@alexsotob
20
@alexsotob
@alexsotob
Production is not sacrosanct anymore
21
@alexsotob
@alexsotob
The New ¿Pyramid?
22
@alexsotob
@alexsotob
23
@alexsotob
@alexsotob
Kubernetes
@alexsotob
@alexsotob
Blue - Green
25
apiVersion: v1
kind: Service
metadata:
name: my-service
labels:
app: mystuff
spec:
ports:
- name: http
port: 8000
selector:
inservice: myappv1
type: LoadBalancer
apiVersion: apps/v1
kind: Deployment
metadata:
name: mynode-deployment
spec:
replicas: 1
selector:
matchLabels:
app: mynode
template:
metadata:
labels:
app: myappv1
spec:
containers:
- name: mynode
image: quay.io/rhdevelopers/mynode:v1
ports:
- containerPort: 8000
kubectl label pod -l app=mypython inservice=myappv2
@alexsotob
@alexsotob
Canary Releases
kubectl scale deployment myapp-v1 --replicas=3
kubectl scale deployment myapp-v2 --replicas=1
26
@alexsotob
@alexsotob
Canary Release
27
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: recommendation
spec:
hosts:
- recommendation
http:
- route:
- destination:
host: recommendation
subset: version-v1
weight: 75
- destination:
host: recommendation
subset: version-v2
weight: 25
@alexsotob
@alexsotob
Shadowing Traffic
28
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: recommendation
spec:
hosts:
- recommendation
http:
- route:
- destination:
host: recommendation
subset: version-v1
mirror:
host: recommendation
subset: version-v2
@alexsotob
@alexsotob
Dark Canary
29
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: recommendation
spec:
hosts:
- recommendation
http:
- match:
- headers:
end-user:
exact: Alexandra
route:
- destination:
host: recommendation
subset: version-v2
- route:
- destination:
host: recommendation
subset: version-v1
@alexsotob
@alexsotob
Next Generation Microservices - Service Mesh
31
Code Independent (Polyglot)
@alexsotob
@alexsotob
Sidecar Container
32
@alexsotob
@alexsotob
Sidecar Container
Pod
Container
JVM
Service A
Sidecar Container
Pod
Container
JVM
Service C
Sidecar Container
Pod
Container
JVM
Service B
Sidecar Container
With Istio
The sidecar intercepts all network traffic
@alexsotob
Live Demo
The most asked question in Istio sessions
35
@alexsotob
@alexsotob
36
Argo Rollouts
@alexsotob
@alexsotob
Argo Rollouts
37
kubectl apply
rollout
Monitors Data
@alexsotob
@alexsotob
Rolling out automatically
38
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: bubblebackend
labels:
app: bubblebackend
spec:
strategy:
canary:
steps:
- setWeight: 20
- pause:
duration: "1m"
- setWeight: 50
- pause:
duration: "2m"
canaryService: bubble-backend-canary
stableService: bubble-backend
trafficRouting:
istio:
virtualService:
name: bubble-backend
routes:
- primary
…
@alexsotob
@alexsotob
Live Demo
Let’s Wind Down
@alexsotob
@alexsotob
Final Notes
41
@alexsotob
@alexsotob