All Products
Search
Document Center

Container Service for Kubernetes:Perform canary releases with ACK One GitOps and Argo Rollouts

Last Updated:Oct 28, 2026

ACK One integrates the GitOps capabilities of Argo CD and works with Argo Rollouts, a progressive delivery controller, to enable fully automated canary releases through Git commits. This solution combines ACK One GitOps with Argo Rollouts to build canary release capabilities for your applications.

Prerequisites

Key concepts

Expand to view GitOps concepts

GitOps

GitOps uses Git repositories to manage application deployment templates. A Git repository serves as the single source of truth for the applications deployed in a Kubernetes cluster, which enables continuous deployment. For more information about GitOps, see GitOps overview.

image

Expand to view Argo Rollouts concepts

Argo Rollouts

Argo Rollouts is a standard extension for Kubernetes that provides advanced deployment capabilities, such as blue-green deployment, canary releases, and Kubernetes progressive delivery.

image

Expand to view canary release concepts

Canary releases

A canary release is a release strategy, also known as a phased release. In a canary release, the version of the backend application is updated in stages in the production environment. The version must support traffic shaping, for example, through an Ingress controller. After the new version is verified as expected on a small scale, it is rolled out to the entire production environment.

Benefits of canary releases

Canary releases allow you to test a new version in a real environment. If the new version has problems, it affects only some users at most. Canary releases also support a safe and fast rollback strategy, which switches the traffic routed to the new version back to an earlier version.

The canary release process

image

Considerations

  • If you use GitHub repositories, avoid using regions in the Chinese mainland. To run in the Chinese mainland, you can select a suitable Git provider.

  • In this topic, the Fleet instance for fleet management and the associated ACK cluster are both deployed in the China (Hong Kong) region as an example.

Step 1: Deploy Argo Rollouts in the ACK cluster

Run the following commands to deploy Argo Rollouts in the ACK cluster. Before you run the commands, switch the kubectl context to the ACK cluster. For more information, see Argo Rollouts documentation.

kubectl create namespace argo-rollouts
kubectl apply -n argo-rollouts -f https://github.com/argoproj/argo-rollouts/releases/latest/download/install.yaml

Step 2: Deploy the ack-arms-prometheus add-on in the ACK cluster

  1. Log on to the ACK console. In the left navigation pane, click Clusters.

  2. On the Clusters page, click the name of your cluster. In the left navigation pane, click Components and Add-ons .

  3. On the Add-ons page, click the Logs and Monitoring tab and find the ack-arms-prometheus add-on.

    • If Installed is displayed in the upper-right corner of the card, the ack-arms-prometheus add-on was already installed when the cluster was created, and no further action is required.

    • If no information is displayed in the upper-right corner of the card, click Install in the lower-right corner of the card to install the add-on in the ACK cluster.

Step 3: Deploy an application by using ACK One GitOps

Two methods are available to deploy an application through GitOps.

  • Deploy the application by using the Argo CD CLI. The following procedure uses this method as an example to describe how to deploy an application through GitOps.

  • Deploy the application through the GitOps console. For more information, see Getting started with GitOps.

  1. Add a Git repository.

    argocd repo add https://github.com/AliyunContainerService/gitops-demo.git --name gitops-demo

    Expected output:

    Repository 'https://github.com/AliyunContainerService/gitops-demo.git' added
  2. Run the following command to view the list of added Git repositories.

    argocd repo list

    Expected output:

    TYPE  NAME         REPO                                                       INSECURE  OCI    LFS    CREDS  STATUS      MESSAGE  PROJECT
    git   gitops-demo  https://github.com/AliyunContainerService/gitops-demo.git  false     false  false  false  Successful
  3. Run the following command to view the list of clusters.

    argocd cluster list

    Expected output:

    SERVER                          NAME                                                                 VERSION  STATUS      MESSAGE                                                  PROJECT
    https://192.168.XX.XX:6443      c76073b011afb4de2a8****-ack-gitops-demo-192-10-110-0-0-16  1.26+    Successful
    https://kubernetes.default.svc  in-cluster                                                                    Unknown     Cluster has no applications and is not being monitored.
  4. Create an application by using an Application resource. Replace 192.168.XX.XX with the SERVER value of your cluster in the output of the argocd cluster list command.

    argocd app create rollouts-demo --repo https://github.com/AliyunContainerService/gitops-demo.git --project default --sync-policy automated --revision rollouts --path  . --dest-namespace default --dest-server https://192.168.XX.XX:6443 
  5. Run the following command to view the list of applications.

    argocd app list

    Expected output:

    NAME           CLUSTER                     NAMESPACE  PROJECT  STATUS  HEALTH   SYNCPOLICY  CONDITIONS  REPO                                            PATH  TARGET
    rollouts-demo  https://192.168.XX.XX:6443  default    default  Synced  Healthy  Auto        <none>      https://github.com/AliyunContainerService/gitops-demo.git  .     rollouts
  6. Run the following command to view the rollout status.

    kubectl argo rollouts get rollout rollouts-demo --watch

    Expected output:

    Name:            rollouts-demo
    Namespace:       default
    Status:          ✓ Healthy
    Strategy:        Canary
      Step:          8/8
      SetWeight:     100
      ActualWeight:  100
    Images:          argoproj/rollouts-demo:red (stable)
    Replicas:
      Desired:       4
      Current:       4
      Updated:       4
      Ready:         4
      Available:     4
    
    NAME                                   KIND        STATUS     AGE  INFO
    ⟳ rollouts-demo                        Rollout     ✓ Healthy  18s
    └──# revision:1
       └──⧫ rollouts-demo-5747959bdb       ReplicaSet  ✓ Healthy  17s  stable
          ├──□ rollouts-demo-5747959bdb-8m825  Pod     ✓ Running  17s  ready:1/1
          ├──□ rollouts-demo-5747959bdb-kpqvh  Pod     ✓ Running  17s  ready:1/1
          ├──□ rollouts-demo-5747959bdb-vfqtm  Pod     ✓ Running  17s  ready:1/1
          └──□ rollouts-demo-5747959bdb-xdkv8  Pod     ✓ Running  17s  ready:1/1

Step 4: Start the canary release

During an Argo Rollouts canary release, you can use the following two methods to verify whether the new application version works as expected. You can then decide whether to further increase the traffic weight of the new version until all traffic is routed to it. The first method is manual verification. The second method is to decide whether to increase the traffic weight of the new version based on the business metrics of the new application version that are collected by Managed Service for Prometheus.

Warning

Each setWeight step in the rollout routes that percentage of live user traffic to the new application version.

On the automatic verification path, if the success rate stays below the 95% threshold for 10 consecutive metric evaluations (failureLimit: 10), the rollout is aborted and all traffic returns to the stable version.

Before you commit the change to the rollout.yaml file, make sure that the image tag is correct. An incorrect image tag affects production users.

Manual verification

  1. In the rollout.yaml file, modify the following content, and then save and commit the changes.

    apiVersion: argoproj.io/v1alpha1
    kind: Rollout
    metadata:
      name: rollouts-demo
    spec:
      replicas: 4
      strategy:
        canary:            # The analysis metric collection section is not required.
          canaryService: rollouts-demo-canary
          stableService: rollouts-demo-stable
          trafficRouting:
            nginx:
              stableIngress: rollouts-demo-stable
          steps:
            - setWeight: 20
            - pause: {}          # This is a pause that requires manual intervention.
            - setWeight: 40
            - pause: {duration: 5m}
            - setWeight: 60
            - pause: {duration: 5m}
            - setWeight: 80
            - pause: {duration: 5m}
      revisionHistoryLimit: 2
      selector:
        matchLabels:
          app: rollouts-demo
      template:
        metadata:
          labels:
            app: rollouts-demo
        spec:
          containers:
          - name: rollouts-demo
            image: argoproj/rollouts-demo:yellow   # Change the image tag.
            ports:
            - name: http
              containerPort: 8080
              protocol: TCP
            resources:
              requests:
                memory: 32Mi
                cpu: 5m        
  2. Run the following command to view the rollout status.

    kubectl argo rollouts get rollout rollouts-demo --watch

    Expected output:

    Name:            rollouts-demo
    Namespace:       default
    Status:          ‖ Paused
    Message:         CanaryPauseStep
    Strategy:        Canary
      Step:          1/8
      SetWeight:     20
      ActualWeight:  20
    Images:          argoproj/rollouts-demo:red (stable)
                     argoproj/rollouts-demo:yellow (canary)
    Replicas:
      Desired:       4
      Current:       5
      Updated:       1
      Ready:         5
      Available:     5
    
    NAME                                   KIND        STATUS     AGE    INFO
    ⟳ rollouts-demo                        Rollout     ‖ Paused   6m39s
    ├──# revision:2
    │  └──⧫ rollouts-demo-6cf78c66c5       ReplicaSet  ✓ Healthy  79s    canary
    │     └──□ rollouts-demo-6cf78c66c5-kqp7x  Pod     ✓ Running  79s    ready:1/1
    └──# revision:1
       └──⧫ rollouts-demo-5747959bdb       ReplicaSet  ✓ Healthy  6m38s  stable
          ├──□ rollouts-demo-5747959bdb-8m825  Pod     ✓ Running  6m38s  ready:1/1
          ├──□ rollouts-demo-5747959bdb-kpqvh  Pod     ✓ Running  6m38s  ready:1/1
          ├──□ rollouts-demo-5747959bdb-vfqtm  Pod     ✓ Running  6m38s  ready:1/1
          └──□ rollouts-demo-5747959bdb-xdkv8  Pod     ✓ Running  6m38s  ready:1/1

    In the rollout.yaml file, at the first pause step, no pause duration is set. The canary release therefore stays paused at this step until a resume or promote action is performed.

  3. Resume the canary release.

    1. In the rollout.yaml file, modify the following content, and then save and commit the changes.

            steps:
              - setWeight: 20
              - pause: {duration: 10s}   # Add a short duration here so that the rollout quickly proceeds to the next step.
    2. After the change is committed, the canary release resumes. Run the following command to view the rollout status.

      kubectl argo rollouts get rollout rollouts-demo --watch

      Expected output:

      Name:            rollouts-demo
      Namespace:       default
      Status:          ‖ Paused
      Message:         CanaryPauseStep
      Strategy:        Canary
        Step:          3/8
        SetWeight:     40
        ActualWeight:  40
      Images:          argoproj/rollouts-demo:red (stable)
                       argoproj/rollouts-demo:yellow (canary)
      Replicas:
        Desired:       4
        Current:       6
        Updated:       2
        Ready:         6
        Available:     6
      
      NAME                                   KIND        STATUS     AGE    INFO
      ⟳ rollouts-demo                        Rollout     ‖ Paused   11m
      ├──# revision:2
      │  └──⧫ rollouts-demo-6cf78c66c5       ReplicaSet  ✔ Healthy  6m17s  canary
      │     ├──□ rollouts-demo-6cf78c66c5-kqp7x  Pod     ✔ Running  6m17s  ready:1/1
      │     └──□ rollouts-demo-6cf78c66c5-lbfcv  Pod     ✔ Running  7s     ready:1/1
      ├──# revision:1
      │  └──⧫ rollouts-demo-5747959bdb       ReplicaSet  ✔ Healthy  11m    stable
      │     ├──□ rollouts-demo-5747959bdb-8m825  Pod     ✔ Running  11m    ready:1/1
      │     ├──□ rollouts-demo-5747959bdb-kpqvh  Pod     ✔ Running  11m    ready:1/1
      │     ├──□ rollouts-demo-5747959bdb-vfqtm  Pod     ✔ Running  11m    ready:1/1
      │     └──□ rollouts-demo-5747959bdb-xdkv8  Pod     ✔ Running  11m    ready:1/1

    After the canary release is complete, the result is as follows.

    Name:            rollouts-demo
    Namespace:       default
    Status:          ✓ Healthy
    Strategy:        Canary
      Step:          8/8
      SetWeight:     100
      ActualWeight:  100
    Images:          argoproj/rollouts-demo:yellow (stable)
    Replicas:
      Desired:       4
      Current:       4
      Updated:       4
      Ready:         4
      Available:     4
    
    NAME                                       KIND        STATUS        AGE    INFO
    ⟳ rollouts-demo                            Rollout     ✓ Healthy     27m
    ├──# revision:2
    │  └──⧫ rollouts-demo-6cf78c66c5           ReplicaSet  ✓ Healthy     22m    stable
    │     ├──□ rollouts-demo-6cf78c66c5-kqp7x  Pod         ✓ Running     22m    ready:1/1
    │     ├──□ rollouts-demo-6cf78c66c5-lbfcv  Pod         ✓ Running     16m    ready:1/1
    │     ├──□ rollouts-demo-6cf78c66c5-74zcv  Pod         ✓ Running     11m    ready:1/1
    │     └──□ rollouts-demo-6cf78c66c5-vt7ns  Pod         ✓ Running     6m3s   ready:1/1
    ├──# revision:1
    │  └──⧫ rollouts-demo-5747959bdb           ReplicaSet  • ScaledDown  27m

Automatic verification based on Managed Service for Prometheus metrics

  1. In the rollout.yaml file, modify the following content, and then save and commit the changes.

      strategy:
        canary:
          analysis:        # Metric analysis configuration.
            templates:     # Metric analysis templates.
            - templateName: success-rate
            startingStep: 2 #delay starting analysis run until setWeight: 40%
            args:
              - name: service-name
                value: rollouts-demo-stable
          canaryService: rollouts-demo-canary
          stableService: rollouts-demo-stable
          trafficRouting:
            nginx:
              stableIngress: rollouts-demo-stable
          steps:
            - setWeight: 20
            - pause: {duration: 5m}
            - setWeight: 40
            - pause: {duration: 5m}
            - setWeight: 60
            - pause: {duration: 5m}
            - setWeight: 80
            - pause: {duration: 5m}
      revisionHistoryLimit: 2
      selector:
        matchLabels:
          app: rollouts-demo
      template:
        metadata:
          labels:
            app: rollouts-demo
        spec:
          containers:
          - name: rollouts-demo
            image: argoproj/rollouts-demo:blue  # Set a new image tag.
  2. Obtain the Service address of Managed Service for Prometheus.

    The Service address uses the standard Kubernetes Service address format {ServiceName}.{Namespace}.svc.{ClusterDomain}:{ServicePort}. For example, in this topic, the Service for Managed Service for Prometheus is deployed in the arms-prom namespace and the exposed Service name is arms-prom-server, the default ClusterDomain of the cluster is cluster.local, and the Service port is 9090. Therefore, the Service address of Managed Service for Prometheus is http://arms-prom-server.arms-prom.svc.cluster.local:9090.

  3. In the analysis.yaml file, add the following configuration for Managed Service for Prometheus business metrics.

    In the following sample, the address field specifies the Service address of Managed Service for Prometheus that you obtained in the previous step. For example, in the following sample code, the canary release succeeds when the proportion of successful requests to the canary application reaches 95% within a collection period, and the canary release then automatically proceeds to the next step. For more information about how to configure metric collection, see Metric collection documentation.

    apiVersion: argoproj.io/v1alpha1
    kind: AnalysisTemplate
    metadata:
      name: success-rate
    spec:
      args:
      - name: service-name
      metrics:
      - name: success-rate
        interval: 5m
        successCondition: result[0] >= 0.95   # Metric evaluation condition.
        failureLimit: 10
        provider:
          prometheus:   # Metric collection service address.
            address: http://arms-prom-server.arms-prom.svc.cluster.local:9090  # Managed Service for Prometheus service address obtained in the previous step.
            query: |
              sum(
                irate(nginx_ingress_controller_requests{status=~"(1|2).*", canary!="" ,service="{{args.service-name}}"}[5m]))
                /
                sum(irate(nginx_ingress_controller_requests{canary!="",service="{{args.service-name}}"}[5m])
              )
  4. Make sure that Managed Service for Prometheus has continuous metric data.

    1. Run the following command to obtain the Ingress information of the ACK cluster, so that you can continuously access the Ingress entry point of the application.

      kubectl get ingress

      Expected output:

      NAME                                        CLASS   HOSTS                 ADDRESS         PORTS   AGE
      rollouts-demo-rollouts-demo-stable-canary   nginx   rollouts-demo.local   8.217.XX.XX   80      9h
      rollouts-demo-stable                        nginx   rollouts-demo.local   8.217.XX.XX   80      9h
    2. Modify the local Hosts file and add the following configuration.

      8.217.XX.XX  rollouts-demo.local
    3. In a separate terminal window, continuously generate access traffic for the application.

       while true; do curl -s "http://rollouts-demo.local/" | grep -o "<title>.*</title>" ;sleep 0.2;done
  5. Run the following command to view the rollout status.

    kubectl argo rollouts get rollout rollouts-demo --watch

    Expected output:

    Name:            rollouts-demo
    Namespace:       default
    Status:          ॥ Paused
    Message:         CanaryPauseStep
    Strategy:        Canary
      Step:          3/8
      SetWeight:     40
      ActualWeight:  40
    Images:          argoproj/rollouts-demo:blue (canary)
                     argoproj/rollouts-demo:yellow (stable)
    Replicas:
      Desired:       4
      Current:       6
      Updated:       2
      Ready:         6
      Available:     6
    
    NAME                                    KIND          STATUS       AGE    INFO
    ◇ rollouts-demo                         Rollout       ॥ Paused     38m
    ├── # revision:3
    │   ├── ⧫ rollouts-demo-687d76d795      ReplicaSet    ✔ Healthy    5m40s  canary
    │   │   ├── □ rollouts-demo-687d76d795-xvrzc  Pod      ✔ Running    5m40s  ready:1/1
    │   │   └── □ rollouts-demo-687d76d795-8ds55  Pod      ✔ Running    39s    ready:1/1
    │   └── α rollouts-demo-687d76d795-3    AnalysisRun   ◌ Running    39s    ✔ 1
    ├── # revision:2
    │   ├── ⧫ rollouts-demo-6cf78c66c5      ReplicaSet    ✔ Healthy    32m    stable
    │   │   ├── □ rollouts-demo-6cf78c66c5-kap7x  Pod      ✔ Running    32m    ready:1/1
    │   │   ├── □ rollouts-demo-6cf78c66c5-lbfcv  Pod      ✔ Running    26m    ready:1/1
    │   │   ├── □ rollouts-demo-6cf78c66c5-74zcv  Pod      ✔ Running    21m    ready:1/1
    │   │   └── □ rollouts-demo-6cf78c66c5-vt7ns  Pod      ✔ Running    16m    ready:1/1
    └── # revision:1
        └── ⧫ rollouts-demo-5747959bdb      ReplicaSet    ● ScaledDown 37m
  6. View the Managed Service for Prometheus metrics.

    1. Log on to the ACK console. In the left navigation pane, click Clusters.

    2. On the Clusters page, click the name of your cluster. In the left navigation pane, click Operations > Prometheus Monitoring.

    3. On the Prometheus Monitoring page, click the Network Monitoring tab, and then click Ingresses.

      The following figure shows the Managed Service for Prometheus metrics.

      Managed Service for Prometheus Ingress monitoring metrics

    After the canary release is complete, the result is as follows.

    Name:            rollouts-demo
    Namespace:       default
    Status:          ✓ Healthy
    Strategy:        Canary
      Step:          8/8
      SetWeight:     100
      ActualWeight:  100
    Images:          argoproj/rollouts-demo:blue (stable)
    Replicas:
      Desired:       4
      Current:       4
      Updated:       4
      Ready:         4
      Available:     4
    
    NAME                                        KIND         STATUS        AGE  INFO
    ⟳ rollouts-demo                             Rollout      ✓ Healthy     53m
    ├──# revision:3
    │  ├──⧉ rollouts-demo-687d76d795            ReplicaSet   ✓ Healthy     21m  stable
    │  │  ├──□ rollouts-demo-687d76d795-xvrzc   Pod          ✓ Running     21m  ready:1/1
    │  │  ├──□ rollouts-demo-687d76d795-8ds55   Pod          ✓ Running     16m  ready:1/1
    │  │  ├──□ rollouts-demo-687d76d795-vl58n   Pod          ✓ Running     11m  ready:1/1
    │  │  └──□ rollouts-demo-687d76d795-h5nwx   Pod          ✓ Running     6m   ready:1/1
    │  └──α rollouts-demo-687d76d795-3          AnalysisRun  ✓ Successful  16m  ✓ 4
    ├──# revision:2
    │  └──⧉ rollouts-demo-6cf78c66c5            ReplicaSet   • ScaledDown  48m
    └──# revision:1
       └──⧉ rollouts-demo-5747959bdb            ReplicaSet   • ScaledDown  53m

(Optional) Step 5: Roll back the canary release

During a canary release, if you find that the application is abnormal, you can roll back the release by modifying the rollout.yaml file. The procedure is as follows.

In the rollout.yaml file, modify the following content, and then save and commit the changes.

    spec:
      containers:
      - name: rollouts-demo
        image: argoproj/rollouts-demo:yellow  # Change this value to the tag of the stable version, then save and commit the change to the Git repository.

Run the following command to view the rollout status.

kubectl argo rollouts get rollout rollouts-demo --watch

Expected output:

Name:            rollouts-demo
Namespace:       default
Status:          ✓ Healthy
Strategy:        Canary
  Step:          8/8
  SetWeight:     100
  ActualWeight:  100
Images:          argoproj/rollouts-demo:yellow (stable)
Replicas:
  Desired:       4
  Current:       4
  Updated:       4
  Ready:         4
  Available:     4

NAME                                       KIND         STATUS        AGE    INFO
⟳ rollouts-demo                            Rollout      ✓ Healthy     66m
├──# revision:4
│  └──⧫ rollouts-demo-6cf78c66c5           ReplicaSet   ✓ Healthy     61m    stable
│     ├──□ rollouts-demo-6cf78c66c5-p7k6w  Pod          ✓ Running     7m18s  ready:1/1
│     ├──□ rollouts-demo-6cf78c66c5-bthgh  Pod          ✓ Running     6m17s  ready:1/1
│     ├──□ rollouts-demo-6cf78c66c5-wlw64  Pod          ✓ Running     5m17s  ready:1/1
│     └──□ rollouts-demo-6cf78c66c5-ldfv9  Pod          ✓ Running     4m17s  ready:1/1
├──# revision:3
│  ├──⧫ rollouts-demo-687d76d795           ReplicaSet   • ScaledDown  34m
│  └──α rollouts-demo-687d76d795-3         AnalysisRun  ✓ Successful  29m    ✓ 4
├──# revision:1
│  └──⧫ rollouts-demo-5747959bdb           ReplicaSet   • ScaledDown  66m

References