1 min • read
Transform a Deployment to a Rollout
Argo Rollouts needs a Rollout resource to know what strategy to apply when rolling out a new version (canary or blue-green). When you are migrating a Deployment to a Rollout to change your deployment strategy, you can reference an existing Deployment since Argo Rollouts v1.0.0. When doing this operation, you should proceed as follows:
- Create a Rollout resource.
- Reference an existing Deployment using the
workloadRef
field. - Apply the new Rollout resource in your cluster.
- Scale-down the existing Deployment by changing the
replicas
field to zero. - To perform future updates of your pod specs, the change should be made to the Pod template field of the Deployment.
Here is an example of a new Rollout manifest:
yaml
apiVersion: argoproj.io/v1alpha1kind: Rolloutmetadata:name: my-rolloutspec:replicas: 5workloadRef:apiVersion: apps/v1kind: Deploymentname: my-deploymentstrategy:canary:steps:- setWeight: 20- pause: {duration: 10s}
And the changes that should be brought to the existing Deployment:
diff
apiVersion: apps/v1kind: Deploymentmetadata:name: my-deploymentspec:- replicas: 5+ replicas: 0