Skip to content

Commit

Permalink
Update multi-cluster user guide and templates
Browse files Browse the repository at this point in the history
Add a quick start guide.
Update the user guide with Multi-cluster Gateway.

Signed-off-by: Lan Luo <luola@vmware.com>
Signed-off-by: Jianjun Shen <shenj@vmware.com>
  • Loading branch information
luolanzone authored and jianjuns committed Jun 2, 2022
1 parent 82d7a67 commit c4003f8
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 36 deletions.
38 changes: 21 additions & 17 deletions docs/multicluster/quick-start.md
@@ -1,24 +1,27 @@
# 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.

<img src="assets/sample-clusterset.svg" width="600" alt="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).

<img src="assets/sample-clusterset.svg" width="800" alt="Antrea Multi-cluster Example ClusterSet">

## Preparation

We assume an Antrea version >= v1.7.0 is used in this guide, and the Antrea
We assume an Antrea version >= `v1.7.0` is used in this guide, and the Antrea
version is set to an environment variable `TAG`. For example, the following
command sets the Antrea version to v1.7.0.
command sets the Antrea version to `v1.7.0`.

```bash
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.

Antrea must be deployed in both cluster A and cluster B. To configure Antrea
Multi-cluster Gateways, `antrea-agent` must be deployed with the `Multicluster`
Expand All @@ -43,25 +46,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
Expand Down
42 changes: 23 additions & 19 deletions docs/multicluster/user-guide.md
Expand Up @@ -18,16 +18,17 @@ with two clusters quickly.

### Preparation

We assume an Antrea version >= v1.7.0 is used in this guide, and the Antrea
We assume an Antrea version >= `v1.7.0` is used in this guide, and the Antrea
version is set to an environment variable `TAG`. For example, the following
command sets the Antrea version to v1.7.0.
command sets the Antrea version to `v1.7.0`.

```bash
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
Expand All @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Expand Up @@ -25,5 +25,6 @@ spec:
secret: leader-access-token
server: https://<LEADER_CLUSTER_IP>:6443
members:
- clusterID: test-cluster-leader
- clusterID: test-cluster-member
namespace: antrea-multicluster

0 comments on commit c4003f8

Please sign in to comment.