- activeService — the Service that receives production traffic (the active color/version).
- previewService (optional) — a Service used to expose the new version for testing without affecting production traffic.

Minimal Rollout spec (blue-green)
Below is a minimal Rollout manifest using the blueGreen strategy. Note the requiredactiveService and optional previewService. Setting autoPromotionEnabled: false disables automatic promotion so you can manually promote via the UI or CLI.
Repository layout
A typical repository contains ablue-green folder with the Rollout manifest and two Service manifests (active and preview).

Service manifests
Both Services select the same pods (same selector). Only the Service names differ so you can route traffic independently to the active or preview ReplicaSet.Example Rollout manifest (10 replicas)
This Rollout runs 10 replicas of the “blue” image in theblue-green namespace and disables auto-promotion to allow manual testing and promotion.
Deploy the manifests
Apply the Rollout and Service YAMLs from the folder that contains them:Verify resources
Inspect theblue-green namespace to confirm the Rollout, ReplicaSet(s), pods, and Services are present. Initially only the “blue” ReplicaSet exists; both Services select the same pods so both will return the blue application.
Introduce a new version (green)
To deploy a new version, update the Rollout’s container image (for example, changesiddharth67/highway-animation:blue to siddharth67/highway-animation:green). With autoPromotionEnabled: false, Argo Rollouts will create a new ReplicaSet for the green image and keep both ReplicaSets running in parallel (blue and green) until you promote.
After updating the image, you will see two ReplicaSets and approximately 20 pods (10 per ReplicaSet):

kubectl -n blue-green get all after the image update:
activeServicecontinues to route production traffic to the active ReplicaSet (blue).previewServiceroutes to the new ReplicaSet (green) for testing without impacting production traffic.
Promote the new version
Use the Argo Rollouts UI or CLI to promote the green ReplicaSet and swap production traffic:kubectl argo rollouts promote <rollout-name>
Promotion updates the Service selector behind activeService so production traffic shifts to green.
Promoting switches production traffic to the promoted ReplicaSet. Ensure you have validated the preview version before promoting. If
autoPromotionEnabled is enabled or omitted, promotion can occur automatically once the new ReplicaSet is ready.Rollback behavior
If the promoted version has problems, you can rollback via the UI or CLI. A rollback:- Updates
activeServiceto point back to the previous ReplicaSet. - Scales down the newer ReplicaSet and scales up the restored ReplicaSet as needed.
- The Rollout controller retains ReplicaSets according to
revisionHistoryLimit(older ReplicaSets may persist until garbage-collected).
- Newer ReplicaSet remains present but is scaled down.
- Old ReplicaSet is scaled back up and becomes active.
- Services are updated to route traffic to the restored ReplicaSet.

Preview Service is optional — include it when you want to route test traffic to the new ReplicaSet without affecting production traffic. If
autoPromotionEnabled is true (or omitted), promotion happens automatically once the new ReplicaSet is ready.Quick reference
| Resource | Purpose | Example / Command |
|---|---|---|
| Rollout (blue-green) | Declarative application of blue-green strategy | See Rollout YAML above |
| Service (active) | Receives production traffic | activeService: highway-bluegreen-active |
| Service (preview) | Exposes new ReplicaSet for testing | previewService: highway-bluegreen-preview |
| Promote | Switch production traffic to new ReplicaSet | kubectl argo rollouts promote highway-bluegreen |
| Verify namespace | List Rollout, ReplicaSets, pods, services | kubectl -n blue-green get all |
| Apply manifests | Deploy Rollout and Services | kubectl apply -f . |
Links and references
- Argo Rollouts — Blue-Green Strategy: https://argoproj.github.io/argo-rollouts/features/bluegreen/
- Kubernetes concepts — Services and ReplicaSets: https://kubernetes.io/docs/concepts/
- kubectl argo rollouts plugin: https://argoproj.github.io/argo-rollouts/commands/