All Products
Search
Document Center

Container Service for Kubernetes:Implement canary releases by using Kruise Rollout based on ACK One GitOps

Last Updated:Sep 20, 2026

ACK One integrates the GitOps capabilities of ArgoCD with the Kruise Rollout component for progressive delivery. This combination allows you to implement fully automated canary releases through Git commits. This topic describes how to use ACK One GitOps and Kruise Rollout to set up canary releases for your applications.

Prerequisites

  • You have enabled the fleet management feature.

  • You have created an ACK cluster and associated it with an ACK One fleet instance. For more information, see Create an ACK managed cluster and Add an associated cluster.

    • To use A/B testing or canary release features, your cluster must be version 1.19 or later.

    • To use the phased release feature, your cluster must be version 1.16 or later.

  • Obtain the KubeConfig for the Fleet instance from the ACK One console, and connect to the Fleet instance using kubectl.

  • You have installed the kubectl-kruise client. For installation instructions, see kubectl-kruise.

Kruise Rollout

Kruise Rollout is an open source progressive delivery framework from the OpenKruise community. It supports phased releases, blue-green deployments, and A/B testing with coordinated traffic and instance scaling. Kruise Rollout can use Prometheus metrics to automate the release process with batching and pauses. It offers transparent integration and is compatible with various workloads, such as Deployments, CloneSets, and StatefulSets. For more information, see Kruise Rollout.

To use Kruise Rollout, you must configure a Rollout resource and apply it to your Kubernetes cluster. No extra operations are required for subsequent application releases and upgrades. Kruise Rollout can be seamlessly and cost-effectively integrated with platforms such as Helm and Platform as a Service (PaaS). The following figure shows the architecture for performing a phased release using Kruise Rollout.gray

Usage notes

  • If you choose a GitHub repository, avoid using a Chinese mainland region. If your workload must run in a Chinese mainland region, select a suitable Git service provider.

  • This topic uses a fleet instance and an associated cluster in the China (Hong Kong) region as an example.

Step 1: Deploy the Kruise Rollout component

  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 Components and Add-ons page, click Install. Then, click the Manage Applications tab, find the ack-kruise card, and click Next.

  4. In the dialog box that appears, confirm the information and click OK.

Step 2: Deploy an application using GitOps

You can deploy applications by using GitOps in one of the following ways:

  • Deploy applications by using the Argo CD CLI. This topic uses this method.

  • Deploy applications from the GitOps console. For more information, see GitOps quick start.

  1. Run the following command to add a Git repository:

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

    Expected output:

    Repository 'https://github.com/openkruise/samples.git' added

    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/openkruise/samples.git false false false false Successful
  2. 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.
  3. Run the following command to create an application. The revision parameter specifies the stable version tag.

    argocd app create rollouts-demo --repo https://github.com/openkruise/samples.git --project default --sync-policy none --revision gitops-demo-version-stable --path gitops-demo --dest-namespace default --dest-server https://192.168.XX.XX:6443
  4. 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 OutOfSync Healthy <none> <none> https://github.com/openkruise/samples.git gitops-demo 616b4b6 
  5. Run the following command to sync the application:

    argocd app sync rollouts-demo

    Expected output:

    Name: argocd/rollouts-demo
    Project: default
    Server: https://192.168.XX.XX:6443
    Namespace: default
    URL: https://127.0.0.1:61231/applications/rollouts-demo
    Repo: https://github.com/openkruise/samples.git
    Target: 616b4b6
    Path: gitops-demo
    SyncWindow: Sync Allowed
    Sync Policy: <none>
    Sync Status: Synced to 616b4b6
    Health Status: Progressing
    
    Operation: Sync
    Sync Revision: 616b4b6e010ba4d71a92c0e7d050162956b169b7
    Phase: Succeeded
    Start: 2023-08-07 16:02:12 +0800 CST
    Finished: 2023-08-07 16:02:13 +0800 CST
    Duration: 1s
    Message: successfully synced (all tasks run)
    
    GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
     Service default echo-server Synced Healthy service/echo-server created
    apps Deployment default echo-server Synced Progressing deployment.apps/echo-server created
    networking.k8s.io Ingress default ingress-demo Synced Progressing ingress.networking.k8s.io/ingress-demo created
    rollouts.kruise.io Rollout default rollouts-demo Synced rollout.rollouts.kruise.io/rollouts-demo created
  6. In the ArgoCD UI, go to the Applications page and click the rollouts-demo application. The application details appear as follows.

    The application details page shows APP HEALTH as Progressing, SYNC STATUS as Synced (synced to commit 125ca2c), and LAST SYNC result as Succeeded. The left filter panel shows 4 Synced resources and 0 OutOfSync resources; 13 Healthy resources and 1 Progressing resource. The main area displays the resource tree of the rollouts-demo application showing associated Kubernetes resources including Service, Rollout, ReplicaSet, and Pod, with most nodes displaying a healthy status.

  7. Run the following command to check the Rollout status:

    kubectl get rollout --kubeconfig <path_to_the_member_cluster_kubeconfig>
    Important
    • You must check the Rollout status from the member cluster. When you run the kubectl get rollout command, you must specify the path to the member cluster's kubeconfig file.

    • Alternatively, you can set the KUBECONFIG environment variable or use another method to switch the context to the member cluster's kubeconfig file.

    Expected output:

    NAME STATUS CANARY_STEP CANARY_STATE MESSAGE AGE
    rollouts-demo Healthy 4 Completed workload deployment is completed 3m22s

Step 3: Start the canary release

The rollout.yaml file in the Git repository defines the Rollout configuration. The release process has four steps:

  • The new version replaces 20% of the old pods, and 20% of traffic is routed to the new version. You must manually approve the rollout to proceed.

  • The new version replaces 40% of the old pods, and 40% of traffic is routed to the new version. The rollout automatically proceeds after a 60-second pause.

  • The new version replaces 60% of the old pods, and 60% of traffic is routed to the new version. The rollout automatically proceeds after a 60-second pause.

  • The new version replaces 80% of the old pods, and 80% of traffic is routed to the new version. The rollout automatically proceeds after a 60-second pause.

apiVersion: rollouts.kruise.io/v1alpha1
kind: Rollout
metadata:
  name: rollouts-demo
  annotations:
    rollouts.kruise.io/rolling-style: partition
spec:
  objectRef:
    workloadRef:
      apiVersion: apps/v1
      kind: Deployment
      name: echo-server
  strategy:
    canary:
      steps:
      - replicas: 20%
        weight: 20 # This step requires manual approval to proceed because no pause duration is set.
      - replicas: 40%
        weight: 40
        pause:
          duration: 60
      - replicas: 60%
        weight: 60
        pause:
          duration: 60
      - replicas: 80%
        weight: 80
        pause:
          duration: 60
      trafficRoutings:
      - service: echo-server
        ingress:
          classType: nginx
          name: ingress-demo
  1. Run the following command to sync the application to the new version. The revision parameter specifies the new version tag.

    argocd app sync rollouts-demo --revision gitops-demo-version-canary

    Expected output:

    Name: argocd/rollouts-demo
    Project: default
    Server: https://192.168.XX.XX:6443
    Namespace: default
    URL: https://127.0.0.1:62461/applications/rollouts-demo
    Repo: https://github.com/openkruise/samples.git
    Target: 616b4b6
    Path: gitops-demo
    SyncWindow: Sync Allowed
    Sync Policy: <none>
    Sync Status: OutOfSync from 616b4b6
    Health Status: Progressing
    
    Operation: Sync
    Sync Revision: 3d14cc011bb090dd2243f70a3741e9b8f5332cb9
    Phase: Succeeded
    Start: 2023-08-07 16:20:07 +0800 CST
    Finished: 2023-08-07 16:20:07 +0800 CST
    Duration: 0s
    Message: successfully synced (all tasks run)
    
    GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
     Service default echo-server Synced Healthy service/echo-server unchanged
    apps Deployment default echo-server OutOfSync Suspended deployment.apps/echo-server configured
    networking.k8s.io Ingress default ingress-demo Synced Progressing ingress.networking.k8s.io/ingress-demo unchanged
    rollouts.kruise.io Rollout default rollouts-demo Synced rollout.rollouts.kruise.io/rollouts-demo configured
  2. Wait for the sync to complete, and then run the following command to check the Rollout status:

    kubectl get rollout --kubeconfig <path_to_the_member_cluster_kubeconfig>
    Important
    • You must check the Rollout status from the member cluster. When you run the kubectl get rollout command, you must specify the path to the member cluster's kubeconfig file.

    • Alternatively, you can set the KUBECONFIG environment variable or use another method to switch the context to the member cluster's kubeconfig file.

    The output shows that the rollout is paused and requires manual approval to proceed:

    NAME STATUS CANARY_STEP CANARY_STATE MESSAGE AGE
    rollouts-demo Progressing 1 StepPaused Rollout is in step(1/4), and you need manually confirm to enter the next step 7m57s
  3. Run the following command to resume the canary release:

    kubectl-kruise rollout approve rollout/rollouts-demo  --kubeconfig <path_to_the_member_cluster_kubeconfig>
    Important
    • You must run the kubectl-kruise command from the member cluster to resume the release. You must specify the path to the member cluster's kubeconfig file.

    • Alternatively, you can set the KUBECONFIG environment variable or use another method to switch the context to the member cluster's kubeconfig file.

    Expected output:

    rollout.rollouts.kruise.io/rollouts-demo approved
  4. Wait for this step to complete, and then run the following command to check the Rollout status:

    kubectl get rollout --kubeconfig <path_to_the_member_cluster_kubeconfig>
    Important
    • You must check the Rollout status from the member cluster. When you run the kubectl get rollout command, you must specify the path to the member cluster's kubeconfig file.

    • Alternatively, you can set the KUBECONFIG environment variable or use another method to switch the context to the member cluster's kubeconfig file.

    The output shows that the next step will start after a 60-second pause:

    NAME STATUS CANARY_STEP CANARY_STATE MESSAGE AGE
    rollouts-demo Progressing 2 StepPaused Rollout is in step(2/4), and wait duration(60 seconds) to enter the next step 9m56s
  5. Kruise Rollout proceeds to the next release step every 60 seconds until the release is complete.

  6. Wait for the release to complete, and then run the following command to check the Rollout status:

    kubectl get rollout --kubeconfig <path_to_the_member_cluster_kubeconfig>
    Important
    • You must check the Rollout status from the member cluster. When you run the kubectl get rollout command, you must specify the path to the member cluster's kubeconfig file.

    • Alternatively, you can set the KUBECONFIG environment variable or use another method to switch the context to the member cluster's kubeconfig file.

    The output shows that the release is complete:

    NAME            STATUS    CANARY_STEP   CANARY_STATE   MESSAGE                                  AGE
    rollouts-demo   Healthy   4             Completed      Rollout progressing has been completed   15m

(Optional) Step 4: Roll back the canary release

If you detect an issue during the canary release, you can perform a rollback by syncing the application to the previous stable version's commit.

Run the following command to sync the application to the old version. The revision parameter specifies the old version tag.

argocd app sync rollouts-demo --revision gitops-demo-version-stable

Expected output:

Project: default
Server: https://192.168.XX.XX:6443
Namespace: default
URL: https://127.0.0.1:49922/applications/rollouts-demo
Repo: https://github.com/Kuromesi/samples.git
Target: 616b4b6
Path: gitops-demo
SyncWindow: Sync Allowed
Sync Policy: <none>
Sync Status: Synced to 616b4b6
Health Status: Progressing

Operation: Sync
Sync Revision: 616b4b6e010ba4d71a92c0e7d050162956b169b7
Phase: Succeeded
Start: 2023-08-07 16:52:53 +0800 CST
Finished: 2023-08-07 16:52:54 +0800 CST
Duration: 1s
Message: successfully synced (all tasks run)

GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
 Service default echo-server Synced Healthy service/echo-server unchanged
apps Deployment default echo-server Synced Suspended deployment.apps/echo-server configured
networking.k8s.io Ingress default ingress-demo Synced Progressing ingress.networking.k8s.io/ingress-demo unchanged
rollouts.kruise.io Rollout default rollouts-demo Synced rollout.rollouts.kruise.io/rollouts-demo unchanged

Related documents