Guide to converting a Kubernetes Deployment into an Argo Rollout using workloadRef, enabling blue green or canary strategies and controlling original Deployment scale down behavior
In this lesson we’ll convert an existing Kubernetes Deployment into an Argo Rollout so the Argo Rollouts controller can manage lifecycle and rollout strategy (for example, blue/green or canary). This approach lets you adopt an existing Deployment without rewriting the pod template by using workloadRef.
Overview
Replace the Deployment kind with an argoproj.io/v1alpha1 Rollout so Argo Rollouts manages the resource.
Use spec.workloadRef to point the Rollout to an existing Deployment (no pod-template rewrite needed).
Configure spec.workloadRef.scaleDown to control what happens to the original Deployment after the Rollout succeeds.
Choose a rollout strategy; this example uses blueGreen and requires activeService (previewService is optional).
Key parts explained
Field
Purpose
Example / Notes
apiVersion / kind
Instructs Kubernetes to treat this as an Argo Rollout managed resource
argoproj.io/v1alpha1 / Rollout
spec.replicas
Number of desired replicas for the Rollout
Same concept as Deployment
spec.workloadRef
Adopts an existing Deployment so the Rollout uses the same pod template
The Rollout resource takes control of the specified Deployment (it “adopts” it).
The Rollout controller will create new ReplicaSets/Pods for the rollout while the original Deployment pods remain until scaleDown policy executes.
With scaleDown: onSuccess, when the Rollout becomes healthy the controller scales the original Deployment to zero, leaving the Rollout-managed pods servicing traffic.
Apply the Rollout and observe the cluster
Initial state (plain Deployment running four replicas):
At this point the Rollout resource controls the application; the original Deployment has been scaled down according to the scaleDown policy, and the blue/green services allow controlled traffic promotion and preview testing.
Note: Using workloadRef allows you to convert an existing Deployment to be managed by Argo Rollouts without rewriting the pod template. Review the available scaleDown options (onSuccess, never, progressive) to choose the behavior that suits your release workflow.