KITA ADALAH SEGALANYA

Saat kau buta dan tak mampu melihat gelap atau terang atau temaram, maka aku yang akan mendeskripsikan pemandangan. Saat aku tuli dan tak mampu mendengar bisikan atau ucapan atau teriakan, maka kau…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Blue Green Deployments using Kubernetes

Source code can be viewed at :

Blue Deployment

Lets say in our cluster we have deployment called bluedeploy. Inside the deployment object we have replica set inside the replica set we have pods.so this deployment which is currently running is considered as blue deployment or production deployment.

Lets say this Blue Deployment running Docker image with tag blue.

Green Deployment

Lets say if i need to upgrade the application . or if i need to deploy a new version of application in this case we will start another similar deployment,
lets say Greendeploy .

In this case we will start another parallel deployment and run it under some non production environment just say test environment.we consider it as a Green deployment.

Lets say this is running another Docker image with tag Green.

3. we will start these two deployments in parallel.

4. once the new deployment- Greendeploy is doing well we will flip the service of old deployment=blueDeploy to new deployment=Greendeploy.
then we will get rid of new service and old deployment.

step1:

create blue deployment which is a active deployment

this deployment has match Labels: app: blue

step2:

lets create a parallel green deployment which is a new deployment

this deployment has match labels matchLabels app: green

step3:

lets create blue service:

we can now access our active application using above external url:

lets describe service1

step4:

lets create green service

step5:

lets describe green service2

lets access green service:

now two parallel services are running.

Lets describe all pods

Figure Two services blue/green pods running.
Figure both App version's are running currently.

once the test environment is running fine.

inital app label:blue

we will flip the blue service object app label:blue to app label:green in blueservice.yml as shown below.

in this case it searches for pod with label label:green.

save and apply the change .

in this case we can refresh the blue deployment url and we can see traffic flowing through green app.

In order to save cost on resources lets delete the new service.

In order to save cost on resources lets delete the old deployment

Finally we have only one deployment :

Finally we have a new deployment with old service object serving the traffic.

Advantages:

The advantage of this “there is no downtime”
2. Shifting to the previous version of app is simple.
3. End user service is not intruppted.

Add a comment

Related posts:

How To Apostille Marriage Certificates

Boston Apostille Service is a leading provider of apostille services in the Boston area. We specialize in helping individuals and businesses obtain apostille certification for their documents, making…

Como deixar de ser solteira ainda em 2023

Em um mundo de regras prontas e desconstrução de valores relacionados a família e maternidade, você precisa estar atenta para Escolher o melhor. >Intelectual: contato com boas referências, bons…

Betrayal

The Iliad of our time, played out in the red dust and sticky mud of a place none of us ever understood. Just a frightened and confused twenty year old boy following orders, doing my job, trying to…