0
0
Kubernetesdevops~5 mins

Blue-green deployments in Kubernetes - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a blue-green deployment?
A blue-green deployment is a method to release software by running two identical environments called 'blue' and 'green'. One serves live traffic while the other is updated. After testing, traffic switches to the updated environment, reducing downtime and risk.
Click to reveal answer
beginner
Why use blue-green deployments in Kubernetes?
Blue-green deployments help avoid downtime and reduce errors by switching traffic between two environments. Kubernetes can manage these environments using services and labels to route traffic smoothly.
Click to reveal answer
intermediate
How does Kubernetes route traffic in a blue-green deployment?
Kubernetes uses Services with selectors that match labels on Pods. By changing the Service's selector from blue to green Pods, traffic shifts instantly without downtime.
Click to reveal answer
intermediate
What is a common risk if blue-green deployments are not done properly?
If traffic is switched before the new environment is fully tested, users may face errors or downtime. Also, keeping both environments can double resource use temporarily.
Click to reveal answer
intermediate
Give a simple example of switching traffic in Kubernetes for blue-green deployment.
You can update the Service selector from 'app: blue' to 'app: green'. For example: kubectl patch service my-service -p '{"spec":{"selector":{"app":"green"}}}'. This moves traffic to green Pods.
Click to reveal answer
What is the main goal of blue-green deployments?
ATo delete old versions immediately
BTo increase server CPU usage
CTo reduce downtime during software updates
DTo run two different apps simultaneously
In Kubernetes, how do you switch traffic from blue to green environment?
AChange the Service selector labels
BRestart all Pods manually
CDelete the blue Pods immediately
DChange the Deployment image only
Which Kubernetes object is primarily used to route traffic in blue-green deployments?
APersistentVolume
BConfigMap
CSecret
DService
What is a downside of blue-green deployments?
ATemporary increased resource usage
BPermanent downtime
CNo way to test new version
DRequires manual code changes
What should you do before switching traffic to the green environment?
ADelete the blue environment
BTest the green environment fully
CRestart the Kubernetes cluster
DChange the Service type to NodePort
Explain how blue-green deployments reduce downtime in Kubernetes.
Think about how traffic moves between two sets of pods.
You got /4 concepts.
    Describe the steps to perform a blue-green deployment in Kubernetes.
    Consider the lifecycle from deployment to cleanup.
    You got /5 concepts.