Canary Rollouts with Argo CD
Argo CD applies your YAML from Git; DisaggregatedSet performs the canary rollout. Add a health check so Argo CD shows when each requested percentage is ready. No custom Argo CD image is needed. The percentage controls replica groups or slices, not request-traffic weights.
Before starting, install an LWS release and matching CRDs that support spec.rolloutStrategy.canary.percent.
Argo CD versions
This guide works with Argo CD 3.0.0 and later. Use a maintained release compatible with your Kubernetes version.
Configure Argo CD
Add the health check
Without this customization, Argo CD can sync a DisaggregatedSet without assessing its readiness. Save this merge patch as argocd-canary-health.yaml:
data:
resource.customizations.health.disaggregatedset.x-k8s.io_DisaggregatedSet: |
local waiting = {status = "Progressing", message = "Waiting for the current DisaggregatedSet status"}
local generation = obj.metadata and obj.metadata.generation
if generation == nil or obj.status == nil or obj.status.observedGeneration ~= generation then
return waiting
end
local available = nil
local progressing = nil
for _, condition in ipairs(obj.status.conditions or {}) do
if condition.observedGeneration == generation and condition.status == "True" then
if condition.type == "Progressing" then
progressing = condition
elseif condition.type == "Available" then
available = condition
end
end
end
if progressing ~= nil then
local status = "Progressing"
if progressing.reason == "CanaryHeld" then
status = "Healthy"
end
return {status = status, message = progressing.message or progressing.reason}
end
if available ~= nil then
if obj.status.canary ~= nil then
return {status = "Progressing", message = "Waiting for previous canary baseline cleanup"}
end
return {status = "Healthy", message = available.message or "All roles are ready"}
end
return waiting
Replace YOUR_CONTEXT and, if needed, the Argo CD namespace:
kubectl --context YOUR_CONTEXT -n argocd patch configmap argocd-cm \
--type merge --patch-file argocd-canary-health.yaml
This replaces the health customization for this kind, not other ConfigMap entries. If Git or Helm manages argocd-cm, make the change there instead. Argo CD loads it automatically; refresh the Application to see the result.
The check reports Healthy for a Ready partial hold (CanaryHeld) or a completed rollout, and Progressing while work remains or status is stale. At 100% or omission, it waits for status.canary to clear after baseline cleanup, even if Available=True. Healthy is not approval to promote: check application errors, latency and model output yourself.
Available=True requires every desired group to be Ready on the new revision. At 25%, 3 A + 1 B can all be Ready while Available=False. The Argo CD health check above reports this settled hold as Healthy. Monitor serving counts and application health alongside MinimumReplicasAvailable: a queued Deferred increase can make that condition False without losing serving capacity. See availability during a rollout.
Connect your deployment repository
Keep your existing Application, or save this as inference-application.yaml. Replace the repository, branch, path and destination. The inference namespace must already exist.
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: inference
namespace: argocd
spec:
project: default
source:
repoURL: https://github.com/YOUR_ORG/inference-config.git
targetRevision: production
path: inference/prod
destination:
server: https://kubernetes.default.svc
namespace: inference
kubectl --context YOUR_CONTEXT apply -f inference-application.yaml
argocd app sync inference
You can also sync from the UI. Synced means the configuration matches Git; Healthy means the requested groups are Ready. An Application can be Synced while still Progressing.
Promote through Git
Start with a healthy revision A. In one Git commit, change the intended role templates to B and add the initial hold to the existing manifest:
spec:
rolloutStrategy:
canary:
percent: 0
dimension: Groups
Keep the rest of your configuration. Committing the templates before the hold can let B deploy immediately. Without an older revision, initial creation starts the full workload even at 0.
Commit, push and sync. Once Healthy, check the application, then change the percentage to 25, commit and sync again. Repeat for 50 and 100. With four Prefill and eight Decode groups, settled counts are:
| Percentage | A Prefill / Decode | B Prefill / Decode |
|---|---|---|
0 | 4 / 8 | 0 / 0 |
25 | 3 / 6 | 1 / 2 |
50 | 2 / 4 | 2 / 4 |
100 | 0 / 0 | 4 / 8 |
Promotion is forward-only: 50 → 25 and 25 → 0 are rejected. Leave the percentage unchanged to hold. Readiness and rollout budgets govern the transitions; the table omits temporary surge groups.
100% finalizes the canary, as does omitting the percentage. Wait for rollout and old-revision cleanup before starting another canary; writing 100 alone is not completion. DisaggregatedSet enforces the completion checks. For the next release, commit its starting percentage together with its new templates—leaving 100 configured would not pause it.
maxSurge: 1 and maxUnavailable: 0 per role. This and the examples below are illustrations, not cluster recordings.Roll back
Restore A’s role templates and remove canary.percent in the same Git commit, then sync. Removing the percentage without restoring A would finish deploying B.
The DisaggregatedSet controller reuses A’s surviving LeaderWorkerSets or recreates them from the restored templates, following readiness and availability budgets. Wait for completion before starting another canary.
Change demand during a canary
Only Immediate applies demand changes during a partial hold. Deferred, the default, queues changes in its direction while promotion can still progress at the previously accepted size. Configure the two directions independently on the DisaggregatedSet:
spec:
scalingPolicy:
scaleUpDuringRollout: Immediate
scaleDownDuringRollout: Immediate
Immediate resizes both shares: at 25%, growing from 4 to 8 groups changes 3 A + 1 B into 6 A + 2 B. Queued Deferred demand keeps Argo CD Progressing. At 100% or omission, ordinary rollout scaling policies resume.
A new Groups canary needs at least two groups per active role/sub-role to split. An already-running canary can retain its last A/B pair when demand drops to one—even with maxSurge: 0—and remains Progressing. See small-role behavior and capacity costs.
More examples
Compare Deferred and Immediate scaling
Canary complete slices
For small roles, divide complete slices instead of each role’s groups. Use Static scaling; slice autoscaling and External scaling with multiple slices are not supported.
This example requires eight slices already running. If needed, change spec.slices in a separate Git commit and wait for completion first. Then commit the new templates and this configuration without changing the slice count:
spec:
slices: 8
rolloutStrategy:
canary:
percent: 25
dimension: Slices
Two slices roll to B and six stay on A. The same health check works. During a partial hold, changes to the dimension or slice count are rejected.
Replace B with C while keeping A
Keep canary.percent: 50 and demand unchanged, but update the templates to C. A’s half stays untouched while B rolls to C. Availability budgets use the full workload, including A.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.