From ae7696cc2d2ade24159d0a25d694377903d7515f Mon Sep 17 00:00:00 2001 From: Lan Luo Date: Wed, 1 Jun 2022 12:09:48 +0800 Subject: [PATCH] Update multi-cluster user guide and templates Add a quick start guide. Update the user guide with Multi-cluster Gateway. Signed-off-by: Lan Luo Signed-off-by: Jianjun Shen --- docs/multicluster/quick-start.md | 31 ++++++++------- docs/multicluster/user-guide.md | 38 ++++++++++--------- .../multicluster_membercluster_template.yaml | 1 + 3 files changed, 39 insertions(+), 31 deletions(-) diff --git a/docs/multicluster/quick-start.md b/docs/multicluster/quick-start.md index f9739c3d57f..d30014dbd2c 100644 --- a/docs/multicluster/quick-start.md +++ b/docs/multicluster/quick-start.md @@ -1,11 +1,13 @@ # Antrea Multi-cluster Quick Start -In this quick start guide, we will set up an Antrea Multi-cluster ClusterSet with -two clusters. One cluster will serve as both the leader and a member cluster, -while another cluster will be a member only. The diagram belows shows the two -clusters and the ClusterSet to be created. +In this quick start guide, we will set up an Antrea Multi-cluster ClusterSet +with two clusters. One cluster will serve as the leader of the ClusterSet, and +meanwhile also join as a member cluster; another cluster will be a member only. -Antrea Multi-cluster Sample ClusterSet +The diagram belows shows the two clusters and the ClusterSet to be created (for +simplicity, the diagram just shows two Nodes for each cluster). + +Antrea Multi-cluster Example ClusterSet ## Preparation @@ -43,25 +45,26 @@ antrea-agent.conf: | ### Step 1 - deploy Antrea Multi-cluster Controllers for leader and member -Run the following commands to deploy Multi-cluster Controller for the member -Namepsace `kube-system`, and Multi-cluster Controller for the leader into -Namespace `antrea-multicluster` (Namespace `antrea-multicluster` will be created -by the commands): +Run the following commands to deploy Multi-cluster Controller for the leader +into Namespace `antrea-multicluster` (Namespace `antrea-multicluster` will be +created by the commands), and Multi-cluster Controller for the member into +Namepsace `kube-system`. ```bash -$kubectl apply -f https://github.com/antrea-io/antrea/releases/download/$TAG/antrea-multicluster-member.yml $kubectl apply -f https://github.com/antrea-io/antrea/releases/download/$TAG/antrea-multicluster-leader-global.yml $kubectl create ns antrea-multicluster $curl -L https://github.com/antrea-io/antrea/releases/download/$TAG/antrea-multicluster-leader-namespaced.yml > antrea-multicluster-leader-namespaced.yml $sed 's/changeme/antrea-multicluster/g' antrea-multicluster-leader-namespaced.yml | kubectl apply -f - +$kubectl apply -f https://github.com/antrea-io/antrea/releases/download/$TAG/antrea-multicluster-member.yml ``` ### Step 2 - initialize ClusterSet -We provide several template files to set up a ClusterSet quicker. You can run -the following commands to create a ClusterSet named `test-clusterset` and obtain -a ServiceAccount token for the member clusters (both cluster A and B in this -guide) to access the leader cluster (cluster A in this guide). +Antrea provides several template YAML manifests to set up a ClusterSet quicker. +You can run the following commands that use the template manifests to create a +ClusterSet named `test-clusteraset` in the leader cluster and obtain a +ServiceAccount token for the member clusters (both cluster A and B in this +guide) to access the leader cluster apiserver (cluster A in this guide). ```bash $kubectl apply -f https://raw.githubusercontent.com/antrea-io/antrea/$TAG/multicluster/config/samples/clusterset_init/multicluster_clusterset_template.yaml diff --git a/docs/multicluster/user-guide.md b/docs/multicluster/user-guide.md index ccd95027b5e..da78558c5b7 100644 --- a/docs/multicluster/user-guide.md +++ b/docs/multicluster/user-guide.md @@ -27,7 +27,8 @@ export TAG=v1.7.0 ``` To use the latest version of Antrea Multi-cluster from the Antrea main branch, -you can change the YAML manifest path to: https://github.com/antrea-io/antrea/tree/main/multicluster/build/yamls/. +you can change the YAML manifest path to: https://github.com/antrea-io/antrea/tree/main/multicluster/build/yamls/ +when applying or downloading an Antrea YAML manifest. Multi-cluster Services require an Antrea Multi-cluster Gateway to be set up in each member cluster, so the Multi-cluster Service traffic can be routed across @@ -54,10 +55,11 @@ A Multi-cluster ClusterSet is comprised of a single leader cluster and at least two member clusters. Antrea Multi-cluster Controller needs to be deployed in the leader and all member clusters. A cluster can serve as the leader, and meanwhile also be a member cluster of the ClusterSet. To deploy Multi-cluster Controller -in a dedicated leader cluster, please refer to [Deploy in a Dedicated Leader cluster](#deploy-in-a-dedicated-leader-cluster). -To deploy Multi-cluster Controller in a member cluster, please refer to -[Deploy in a Member Cluster](#deploy-in-a-member-cluster). To deploy Multi-cluster -Controller in a dual-role cluster, please refer to [Deploy Leader and Member in One Cluster](#deploy-leader-and-member-in-one-cluster). +in a dedicated leader cluster, please refer to [Deploy in a Dedicated Leader +cluster](#deploy-in-a-dedicated-leader-cluster). To deploy Multi-cluster +Controller in a member cluster, please refer to [Deploy in a Member Cluster](#deploy-in-a-member-cluster). +To deploy Multi-cluster Controller in a dual-role cluster, please refer to +[Deploy Leader and Member in One Cluster](#deploy-leader-and-member-in-one-cluster). #### Deploy in a Dedicated Leader Cluster @@ -94,10 +96,10 @@ kubectl apply -f https://github.com/antrea-io/antrea/releases/download/$TAG/antr We need to run two instances of Multi-cluster Controller in the dual-role cluster, one in leader mode and another in member mode. -1. Follow the steps in section [Deploy in a Member Cluster](#deploy-in-a-member-cluster) +1. Follow the steps in section [Deploy in a Dedicated Leader Cluster](#deploy-in-a-dedicated-leader-cluster) + to deploy the leader controller and import the Multi-cluster CRDs. +2. Follow the steps in section [Deploy in a Member Cluster](#deploy-in-a-member-cluster) to deploy the member controller. -2. Follow the steps in section [Deploy in a Dedicated Leader Cluster](#deploy-in-a-dedicated-leader-cluster) - to deploy the leader controller and the Multi-cluster CRDs. ### Create ClusterSet @@ -280,13 +282,15 @@ the ClusterSet. #### Initialize ClusterSet for a Dual-role Cluster When you want to make the leader cluster `test-cluster-north` also a member in -the ClusterSet, make sure you follow the steps in [Deploy Leader and Member in One Cluster](#deploy-leader-and-member-in-one-cluster) -and repeat the steps in [Set up Access to Leader Cluster](#set-up-access-to-leader-cluster) -as well to create the token Secret and copy the token. Don't forget replace all `east` to `north` -before you repeat the steps. +the ClusterSet, make sure you follow the steps in [Deploy Leader and Member in +One Cluster](#deploy-leader-and-member-in-one-cluster) and repeat the steps in +[Set up Access to Leader Cluster](#set-up-access-to-leader-cluster) as well to +create the token Secret and copy the token. Don't forget replace all `east` to +`north` before you repeat the steps. -Then create below `ClusterClaim` and `ClusterSet` in the cluster `test-cluster-north` in the -`kube-system` Namespace where the member Multi-cluster Controller runs. +Then create the `ClusterClaim` and `ClusterSet` CRs in cluster +`test-cluster-north` in the `kube-system` Namespace (where the member +Multi-cluster Controller runs): ```yaml apiVersion: multicluster.crd.antrea.io/v1alpha1 @@ -320,9 +324,9 @@ spec: namespace: antrea-multicluster ``` -Then update the ClusterSet `test-clusterset` definition as below to include itself -as a member cluster in the Namespace `antrea-multicluster` where the leader controller is -running in the cluster `test-cluster-north`. +Last, update the ClusterSet `test-clusterset` in Namepsace `antrea-multicluster` +(where the leader Multi-cluster Controller runs) to include `test-cluster-north` +as a member cluster of the ClusterSet: ```yaml apiVersion: multicluster.crd.antrea.io/v1alpha1 diff --git a/multicluster/config/samples/clusterset_init/multicluster_membercluster_template.yaml b/multicluster/config/samples/clusterset_init/multicluster_membercluster_template.yaml index 28eaa8d0c63..44a474c1352 100644 --- a/multicluster/config/samples/clusterset_init/multicluster_membercluster_template.yaml +++ b/multicluster/config/samples/clusterset_init/multicluster_membercluster_template.yaml @@ -25,5 +25,6 @@ spec: secret: leader-access-token server: https://:6443 members: + - clusterID: test-cluster-leader - clusterID: test-cluster-member namespace: antrea-multicluster