What is the primary benefit of using a blue-green deployment strategy in Kubernetes?
Think about how traffic is managed during updates.
Blue-green deployment uses two identical environments (blue and green). Traffic switches from one to the other to avoid downtime during updates.
You have two deployments named app-blue and app-green. The Kubernetes service app-service currently routes traffic to app-green. What is the output of this command?
kubectl get endpoints app-service -o jsonpath='{.subsets[*].addresses[*].targetRef.name}'The service routes traffic to the currently active deployment pods.
The command shows pod names behind the service. Since app-service routes to app-green, the output is app-green.
You want to switch traffic from app-blue to app-green by updating the service selector. Which of the following kubectl patch commands correctly updates the service selector to point to app=green?
Service selectors are under spec.selector.
To switch traffic, update the service's selector to app=green. Option C correctly patches spec.selector.
Arrange the steps in the correct order to perform a blue-green deployment traffic switch in Kubernetes.
Think about deploying, verifying, switching traffic, then cleaning up.
First deploy new pods, verify they are healthy, then update the service selector to switch traffic, and finally remove old pods.
After updating the service selector to app=green, users still reach the old version app-blue. What is the most likely cause?
Consider pod readiness and how Kubernetes routes traffic.
If pods are not ready, the service will not route traffic to them, so users still reach old pods.