Example Documentation: Blue Green Release
Goal
Trace a release without changing an existing Deployment image in place: start the new version, validate it, switch the Service and roll back if needed.
What Is Done
The lab creates two Deployments with different content. The checkout Service initially targets Blue. Green can be smoke-tested through a separate Service before taking over production traffic.
Typical Commands
kubectl apply -f manifests/
kubectl get endpoints -n release-lab checkout
kubectl port-forward -n release-lab svc/checkout-green 8081:80
kubectl patch service checkout -n release-lab --type=merge -p '{"spec":{"selector":{"app":"checkout","track":"green"}}}'
Validate Success
- Blue has three ready Pods.
- Green has one ready Pod.
checkouttargets Green endpoints after the patch.- Rollback is another Service patch.
Common Mistakes
- Service selectors match no Pods.
- Green is not tested separately before production traffic switches.
- Old Blue Pods are deleted too early, making rollback unnecessarily expensive.