Skip to content

therealdavidbour/canary

Repository files navigation

Canary Deployments using Kubernetes Namespaces and Ingress Nginx

bg bg

Quickstart

  1. Create Namespaces
kubectl create ns nginx-blue
kubectl create ns nginx-green
kubectl create ns canary-bg-switch
  1. Setup your /etc/hosts to point to the custom URL within blue-ingress.yaml and green-ingress.yaml
  2. Install the manifests
kubectl apply -f blue-ingress.yaml -n canary-bg-switch
kubectl apply -f green-ingress.yaml -n canary-bg-switch
kubectl apply -f blue-service.yaml -n canary-bg-switch
kubectl apply -f green-service.yaml -n canary-bg-switch
kubectl apply -f blue-app.yaml -n nginx-blue
kubectl apply -f green-app.yaml -n nginx-green
  1. Split the traffic to send 20% of the traffic to the blue-ingress.yaml
kubectl patch ingress canary-blue-ingress -n canary-bg-switch --type=json -p '[{"op": "replace", "path": "/metadata/annotations/nginx.ingress.kubernetes.io~1canary-weight", "value": "20"}]'
  1. Run the monitor.sh script to verify traffic split
Blue: 9 (20%), Green: 36 (80%), Total: 45

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors