Canary Rollouts with Argo CD

Configure Argo CD, promote a DisaggregatedSet through Git, and roll back safely.

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.

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:

PercentageA Prefill / DecodeB Prefill / Decode
04 / 80 / 0
253 / 61 / 2
502 / 42 / 4
1000 / 04 / 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.

0:00 / 0:00
Speed

New groups become Ready before old groups leave, using maxSurge: 1 and maxUnavailable: 0 per role. This and the examples below are illustrations, not cluster recordings.

Roll back

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.

More examples

Compare Deferred and Immediate scaling
0:00 / 0:00
Speed

Request more capacity, promote to 50%, then request less. Deferred keeps the admitted size in both directions.
0:00 / 0:00
Speed

Immediate doubles demand, then halves it. Both revisions resize; availability and surge budgets still apply.
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.

0:00 / 0:00
Speed

Promote selected Prefill/Decode pairs, replace B with C, then finish. These are settled states; each slice rolls progressively within its budgets.
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.

0:00 / 0:00
Speed

A keeps two Prefill and four Decode groups while Ready C groups replace B in the other half.

Feedback

Was this page helpful?