Skip to main content

workloadRef Migration (Argo CD / Helm)

Migrate to Argo Rollouts without an immediate resource swap. The Rollout references the existing Deployment via workloadRef and progressively scales it down as the Rollout becomes healthy. Ideal for Argo CD– or Helm-managed apps. See Onboarding for validation and ArgoCD GitOps for ignoreDifferences.


Prerequisites​

ComponentStatus
Kubernetes clusterAccessible via kubectl
Argo RolloutsInstalled (kubectl get rollouts -A)
Argo Rollout MCP ServerRunning (Docker recommended)
Existing DeploymentExists in target namespace
Argo CD (optional)If Deployment is Argo CD–managed, use GitOps path for scale-down

Environment Setup​

Verify Deployment​

kubectl get deployment hello-world -n default
kubectl get svc -n default | grep hello-world
docker run --rm -it \
-p 8768:8768 \
-v ~/.kube:/app/.kube:ro \
-e K8S_KUBECONFIG=/app/.kube/config \
talkopsai/argo-rollout-mcp-server:latest

Key Difference: Direct vs workloadRef​

AspectDirect Conversion (Onboarding)workloadRef (This Workflow)
DeploymentScaled down, then replaced by RolloutKept; Rollout references it
DowntimeBrief gap during swapNone β€” Rollout and Deployment run in parallel
Scale-downManual or automaticAutomatic: never, onsuccess, or progressively
Use caseSimple swapArgo CD / Helm-managed, cautious migration

Convert with workloadRef Workflow (Co-Existence)​

StepActionPrompt / Tool
1Validate"Check if hello-world deployment in default is ready to migrate to Argo Rollouts."
2Convert"Convert the hello-world deployment in default to an Argo Rollout using workloadRef mode β€” keep the existing Deployment running and scale it down only on success. Apply to cluster."
3Or use toolconvert_deployment_to_rollout(deployment_name="hello-world", namespace="default", strategy="canary", migration_mode="workload_ref", scale_down="never", apply=True)
4Verify"Show me the status of the hello-world rollout in default namespace."

Argo CD ignoreDifferences Workflow​

When using workloadRef with Argo CD–managed apps, add ignoreDifferences so Argo CD doesn't revert the Rollout's scale-down of the Deployment.

StepActionPrompt / Tool
1Generate"Generate ArgoCD ignoreDifferences for hello-world in default with include_deployment_replicas for workloadRef."
2Or use toolgenerate_argocd_ignore_differences(include_deployment_replicas=True, deployment_name="hello-world")
3Add to ApplicationPaste output into Application.spec.ignoreDifferences

Trigger New Version & Verify Scale-Down Workflow​

StepActionPrompt / Tool
1Deploy new image"Deploy hello-world:v2 to the hello-world rollout in default."
2Promote"Promote the hello-world rollout in default to the next step." (repeat until 100%)
3VerifyWith scale_down="onsuccess", Deployment scales to 0 when Rollout is Healthy
4Check Deploymentkubectl get deployment hello-world -n default (replicas should be 0 after promotion)

Update scaleDown Workflow​

Change scale_down from never to onsuccess or progressively when ready.

StepActionPrompt / Tool
1Update scaleDown"Change the workloadRef scaleDown on hello-world rollout in default to progressively scale down the Deployment."
2Or use toolargo_update_rollout(update_type='workload_ref', name="hello-world", namespace="default", scale_down="progressively")
3Verify"Show me the status of the hello-world rollout in default namespace."

Scale Down Deployment β€” GitOps Path​

When Deployment is managed by Argo CD, cluster-direct scale is reverted. Use Git commit.

StepActionPrompt / Tool
1Generate manifest"Generate a scale-down manifest for the hello-world deployment in default β€” I'll commit it to Git for Argo CD to apply."
2Or use toolargo_manage_legacy_deployment(action='generate_scale_down_manifest', name="hello-world", namespace="default")
3Commit to GitAdd the returned Deployment YAML (with replicas: 0) to your repo
4SyncArgo CD applies the change

Scale Down Deployment β€” Non-GitOps Path​

When Deployment is not managed by Argo CD.

StepActionPrompt / Tool
1Scale to 0Use tool: argo_manage_legacy_deployment(action='scale_cluster', name="hello-world", namespace="default", replicas=0)
2Verifykubectl get deployment hello-world -n default

Delete Deployment (Non-GitOps Only)​

StepActionPrompt / Tool
1DeleteUse tool: argo_manage_legacy_deployment(action='delete_cluster', name="hello-world", namespace="default")
2WarningOnly when Deployment is not managed by Argo CD. Argo CD will recreate if still in Git.

Natural Language Prompts​

Copy-paste these prompts into your MCP client (Cursor, Claude, etc.).

Convert with workloadRef​

"Convert the hello-world deployment in default to an Argo Rollout using workloadRef mode β€” keep the existing Deployment running and scale it down only on success. Apply to cluster."
"Convert deployment hello-world in default to a canary rollout using workload_ref migration mode with progressive scale-down. Apply directly."

Update scaleDown​

"Change the workloadRef scaleDown on hello-world rollout in default to progressively scale down the Deployment."
"Update hello-world rollout in default β€” set workloadRef scaleDown to onsuccess so the Deployment scales down when the Rollout is healthy."

Manage Legacy Deployment​

"Generate a scale-down manifest for the hello-world deployment in default β€” I'll commit it to Git for Argo CD to apply."
"Generate YAML to scale hello-world deployment in default to 0 replicas for GitOps."
"Scale the hello-world deployment in default to 0 replicas. (Only if NOT managed by Argo CD.)"
"Delete the hello-world deployment in default β€” we've fully migrated to the Rollout. (Only if NOT managed by Argo CD.)"

Quick Reference: Tool β†’ Prompt Mapping​

ToolExample Prompt
validate_deployment_ready"Check if hello-world deployment in default is ready to migrate."
convert_deployment_to_rollout (workload_ref)"Convert hello-world to canary rollout using workloadRef mode, apply to cluster."
argo_update_rollout (workload_ref)"Change workloadRef scaleDown on hello-world rollout to progressively."
generate_argocd_ignore_differences"Generate ignoreDifferences for hello-world with include_deployment_replicas."
argo_manage_legacy_deployment (generate_scale_down_manifest)"Generate scale-down manifest for hello-world deployment for GitOps."
argo_manage_legacy_deployment (scale_cluster)Use tool with action='scale_cluster', replicas=0 (non-GitOps only)
argo_manage_legacy_deployment (delete_cluster)Use tool with action='delete_cluster' (non-GitOps only)

Troubleshooting​

IssueCheck
Argo CD reverts Deployment scale-downAdd generate_argocd_ignore_differences(include_deployment_replicas=True, deployment_name="hello-world") to Application. Use Git path: generate_scale_down_manifest β†’ commit.
Rollout has no workloadRefEnsure migration_mode="workload_ref" was used in convert_deployment_to_rollout.
scale_down invalidMust be never, onsuccess, or progressively.
Deployment still running after promotionCheck scale_down β€” if never, update to onsuccess or progressively via argo_update_rollout(update_type='workload_ref').
generate_scale_down_manifest returns emptyProvide name or deployment_yaml. For live Deployment, use name="hello-world".

Next Steps​