Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jhandguy/canary-deployment
A sample project showcasing various Canary Deployment solutions.
https://github.com/jhandguy/canary-deployment
argo-rollouts canary-deployment helm ingress-nginx k6 kind kubernetes prometheus
Last synced: 3 months ago
JSON representation
A sample project showcasing various Canary Deployment solutions.
- Host: GitHub
- URL: https://github.com/jhandguy/canary-deployment
- Owner: jhandguy
- License: mit
- Created: 2021-12-29T10:32:14.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-30T09:47:13.000Z (3 months ago)
- Last Synced: 2024-10-30T10:28:15.350Z (3 months ago)
- Topics: argo-rollouts, canary-deployment, helm, ingress-nginx, k6, kind, kubernetes, prometheus
- Language: Go
- Homepage:
- Size: 85.9 KB
- Stars: 8
- Watchers: 1
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Canary Deployment
A sample project showcasing various Canary Deployment solutions.
## Blog Posts
- [Canary Deployment in Kubernetes (Part 1) — Simple Canary Deployment using Ingress NGINX](https://jhandguy.github.io/posts/simple-canary-deployment/)
- [Canary Deployment in Kubernetes (Part 2) — Automated Canary Deployment using Argo Rollouts](https://jhandguy.github.io/posts/automated-canary-deployment/)
- [Canary Deployment in Kubernetes (Part 3) — Smart Canary Deployment using Argo Rollouts and Prometheus](https://jhandguy.github.io/posts/smart-canary-deployment/)## Installing
### Using ingress-nginx
```shell
kind create cluster --image kindest/node:v1.27.3 --config=kind/cluster.yamlhelm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm install ingress-nginx/ingress-nginx --name-template ingress-nginx --create-namespace -n ingress-nginx --values kind/ingress-nginx-values.yaml --version 4.8.3 --waithelm install sample-app/helm-charts/ingress-nginx --name-template sample-app --create-namespace -n sample-app --wait
helm upgrade sample-app sample-app/helm-charts/ingress-nginx -n sample-app --reuse-values --set canary.weight=50 --wait
```### Using argo-rollouts
```shell
kind create cluster --image kindest/node:v1.27.3 --config=kind/cluster.yamlhelm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm install ingress-nginx/ingress-nginx --name-template ingress-nginx --create-namespace -n ingress-nginx --values kind/ingress-nginx-values.yaml --version 4.8.3 --waithelm repo add argo https://argoproj.github.io/argo-helm
helm install argo/argo-rollouts --name-template argo-rollouts --create-namespace -n argo-rollouts --set dashboard.enabled=true --version 2.32.5 --waithelm install sample-app/helm-charts/argo-rollouts --name-template sample-app --create-namespace -n sample-app --wait
kubectl argo rollouts dashboard -n argo-rollouts &
kubectl argo rollouts set image sample-app sample-app=ghcr.io/jhandguy/canary-deployment/sample-app:latest -n sample-app
kubectl argo rollouts promote sample-app -n sample-app
```### Using argo-rollouts + prometheus
```shell
kind create cluster --image kindest/node:v1.27.3 --config=kind/cluster.yamlhelm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm install ingress-nginx/ingress-nginx --name-template ingress-nginx --create-namespace -n ingress-nginx --values kind/ingress-nginx-values.yaml --version 4.8.3 --waithelm repo add argo https://argoproj.github.io/argo-helm
helm install argo/argo-rollouts --name-template argo-rollouts --create-namespace -n argo-rollouts --set dashboard.enabled=true --version 2.32.5 --waithelm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm install prometheus-community/kube-prometheus-stack --name-template prometheus --create-namespace -n prometheus --version 54.2.2 --waithelm install sample-app/helm-charts/argo-rollouts --name-template sample-app --create-namespace -n sample-app --set prometheus.enabled=true --wait
kubectl argo rollouts dashboard -n argo-rollouts &
kubectl argo rollouts set image sample-app sample-app=ghcr.io/jhandguy/canary-deployment/sample-app:latest -n sample-app
kubectl argo rollouts promote sample-app -n sample-app
```## Smoke Testing
### Weighted canary
```shell
curl localhost/success -H "Host: sample.app" -v
curl localhost/error -H "Host: sample.app" -v
```### Always canary
```shell
curl localhost/success -H "Host: sample.app" -H "X-Canary: always" -v
curl localhost/error -H "Host: sample.app" -H "X-Canary: always" -v
```### Never canary
```shell
curl localhost/success -H "Host: sample.app" -H "X-Canary: never" -v
curl localhost/error -H "Host: sample.app" -H "X-Canary: never" -v
```## Load Testing
```shell
k6 run k6/script.js
```## Uninstalling
```shell
kind delete cluster
```