You may face multiple challenges when you distribute an application across multiple clusters. For example, the kubeconfig files that are used to access the clusters are not unique, different configurations are used to deploy the application across clusters, no unified view is provided to check the deployment progress of the application, and risks may arise when you deploy the application across multiple clusters. To resolve these challenges, you can use the multi-cluster management feature provided by Alibaba Cloud Distributed Cloud Container Platform (ACK One) to distribute an application across multiple clusters. This topic describes how to use the multi-cluster management feature provided by ACK One to distribute an application across multiple clusters.

Background information

You can create master instances in ACK One to manage clusters. Master instances are developed based on open source KubeVela and Open Cluster Management. Master instances provide standard Kubernetes APIs that can be used to distribute Kubernetes resources across multiple clusters. Master instances also allow you to use different configurations to deploy an application across clusters and perform canary releases for an application among clusters based on workflows.

How application distribution works

Application distribution based on impersonation

For example, after User A creates or modifies an application on a master instance, the master instance distributes the resources that are used by the application to multiple associated clusters. During this process, the master instance impersonates User A and sends resource creation requests or resource modification requests to the associated clusters. The creators or modifiers of these resources in the associated clusters are User A. This meets the requirements for separately auditing the associated clusters and improves cluster security. The following figure shows how an application is distributed based on impersonation. 分发概述

Procedure

To use a master instance in ACK One to distribute an application across multiple clusters, perform the following two steps:

  1. Create the Kubernetes resources that are used by the application. You can configure distribution rules in Step 2. The following table describes the resources that can be distributed across clusters.
    Note The distribution of the following resources does not trigger the creation of other relevant resources because master instances do not monitor the creation of resources. For example, the distribution of Deployments does not trigger the creation of pods and the distribution of Services does not trigger the creation of endpoints.
    Kind apiVersion
    Deployment apps/v1
    Service v1
    Ingress networking.k8s.io/v1
    ConfigMap v1
    Secret v1
    StatefulSet apps/v1
    PersistentVolumeClaim v1
    ServiceExport multicluster.x-k8s.io/v1alpha1
    ServiceImport multicluster.x-k8s.io/v1alpha1
    HorizontalPodAutoscaler autoscaling/v1
  2. Create rules on the master instance to distribute the resources. You can create rules to reference the Kubernetes resources that are created in Step 1, select the clusters in which you want to deploy the application, use different configurations to deploy the application, and use the workflows feature to distribute the application.

Features

Feature Description References
Deploy an application across multiple clusters You can use a master instance in ACK One to deploy an application across the clusters that are associated with the master instance. To use the preceding method, you must create Kubernetes resources, such as Deployments, Services, and Ingresses, for the application. Then, you must specify the clusters in which you want to deploy the application. After you specify the clusters, create the application. You can view the deployment progress of the application in each cluster. Deploy an application across multiple clusters
Use different configurations to deploy an application across multiple clusters ACK One allows you to use a master instance to deploy an application across multiple clusters. You can also use different configurations to deploy the application across the clusters. For example, you can specify different numbers of replicated pods, OS images, or environment variables for the application. Use different configurations to deploy an application across multiple clusters
Use canary releases to deploy an application across clusters ACK One provides the workflows feature. This feature allows you to use canary releases to deploy an application. For example, you can first deploy an application in a testing cluster. If the application passes the test, you can deploy the application in production clusters. This helps minimize potential risks. Use canary release to deploy an application
Select clusters to distribute an application When you use a master instance in ACK One to distribute an application, you must select the clusters to which you want to distribute the application. ACK One allows you to distribute an application to the clusters that are associated with a master instance by specifying the cluster names or labels. Select a cluster to distribute applications
Rules for using different configurations to deploy an application across multiple clusters ACK One allows you to use a master instance to deploy an application across multiple clusters. You can also use different configurations to deploy the application across the clusters. Rules for using different configurations to deploy an application across multiple clusters