🔧 Blue/green deployment with helm hands-on
Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to
QuickCap
Kubernetes uses RollingUpdate as the default deployment strategy, which transition to new version gradually.
Blue/green deployment strategy is about there're always 2 replica versions of application, this makes it easier to rollback to the previous version, if something goes wrong with the new release, and of course it's ideal for stateless application only.
Foreword
This post is about give you an overview picture of how blue/green deployment. There's no good practices, and re-use code well. If it's your thing, coninue reading :))
Resource
Clone repo: https://github.com/truc3651/devops
Quick look at the structure
Folder app contains everything for helm to release our app.
app/templates: where application template resident (deployment, config, secret, service)
app/Chart.yaml: release information (app name, version)
app/values.yaml: default environment variables that helm will use when install/upgrade app
deployment.sh: contains job visualize how blue/green deployment
Get your hands dirty
Install helm, kind
We use kind as local Kubernetes clusters.
brew install helm kind
Create a default cluster
kind create cluster --name helm
Change mod script
chmod +x ./deployment.sh
First time deploy your application
./deployment.sh init
We just create a deployment with 1 pod (default version blue)
At the beginning, service points to pod has label app=app
Release a new version
After weeks, your development team want to release new features.
./deployment.sh deploy-green
You can see blue pod has been terminated, and a new green pod has been created, also green deployment created as well.
Now our service points to pod which has label color=green
Release a new version 3rd time
After many weeks, your team want to introduce bunch cool features
./deployment.sh deploy-new-blue
This time, green pod has been terminated, and a new blue pod has been created.
And our service points to pod which has label color=blue
Rollback
The very new version has some critical bugs, so our team decides to rollback to the previous version
./deployment.sh rollback
🔧 Blue/green deployment with helm hands-on
📈 52.35 Punkte
🔧 Programmierung
🔧 Deployment strategies: Canary or Blue-Green?
📈 29.95 Punkte
🔧 Programmierung
🔧 Blue-Green Deployment with Azure
📈 29.95 Punkte
🔧 Programmierung
🔧 Safe Blue-Green Docker-Compose Deployment
📈 29.95 Punkte
🔧 Programmierung
🔧 Understanding Blue-Green Deployment Strategy
📈 29.95 Punkte
🔧 Programmierung