Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Multi-cluster architecture doc #3638

Merged
merged 2 commits into from
Jun 14, 2022
Merged

Conversation

luolanzone
Copy link
Contributor

@luolanzone luolanzone commented Apr 14, 2022

Update MC architecture doc and change old diagrams' format from png to svg.

Signed-off-by: Lan Luo [email protected]

@luolanzone luolanzone added the area/multi-cluster Issues or PRs related to multi cluster. label Apr 14, 2022
@codecov-commenter
Copy link

codecov-commenter commented Apr 14, 2022

Codecov Report

Merging #3638 (5894ae2) into main (ea99ee5) will decrease coverage by 2.71%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3638      +/-   ##
==========================================
- Coverage   63.37%   60.66%   -2.72%     
==========================================
  Files         288      293       +5     
  Lines       41223    43224    +2001     
==========================================
+ Hits        26127    26222      +95     
- Misses      13000    14854    +1854     
- Partials     2096     2148      +52     
Flag Coverage Δ
kind-e2e-tests 44.88% <ø> (-5.19%) ⬇️
unit-tests 44.56% <ø> (+0.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...g/agent/apiserver/handlers/featuregates/handler.go 4.54% <0.00%> (-77.28%) ⬇️
pkg/apis/controlplane/v1beta2/helper.go 40.00% <0.00%> (-60.00%) ⬇️
...kg/apiserver/registry/system/supportbundle/rest.go 22.17% <0.00%> (-50.44%) ⬇️
pkg/support/dump.go 7.90% <0.00%> (-49.16%) ⬇️
pkg/support/dump_others.go 0.00% <0.00%> (-44.74%) ⬇️
pkg/agent/controller/networkpolicy/fqdn.go 39.51% <0.00%> (-36.00%) ⬇️
...g/agent/apiserver/handlers/addressgroup/handler.go 5.00% <0.00%> (-35.00%) ⬇️
...agent/apiserver/handlers/appliedtogroup/handler.go 5.00% <0.00%> (-35.00%) ⬇️
pkg/agent/controller/networkpolicy/reject.go 50.58% <0.00%> (-34.71%) ⬇️
...kg/agent/controller/networkpolicy/audit_logging.go 56.30% <0.00%> (-27.74%) ⬇️
... and 75 more

docs/multicluster/architecture.md Outdated Show resolved Hide resolved
docs/multicluster/architecture.md Outdated Show resolved Hide resolved
docs/multicluster/user-guide.md Outdated Show resolved Hide resolved
docs/multicluster/user-guide.md Outdated Show resolved Hide resolved
docs/multicluster/user-guide.md Outdated Show resolved Hide resolved
Copy link
Contributor

@jianjuns jianjuns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we generally use only SVG diagram in the repo.

docs/multicluster/architecture.md Outdated Show resolved Hide resolved
docs/multicluster/architecture.md Outdated Show resolved Hide resolved
docs/multicluster/architecture.md Outdated Show resolved Hide resolved
docs/multicluster/architecture.md Outdated Show resolved Hide resolved
@luolanzone luolanzone added this to the Antrea v1.7 release milestone Apr 28, 2022
@luolanzone luolanzone force-pushed the mc-dp-docs branch 2 times, most recently from 8829bf3 to dea9cdb Compare May 10, 2022 02:35
@luolanzone luolanzone changed the title Add docs about Multi-cluster data plane change Add docs about Multi-cluster Service connectivity May 10, 2022
@luolanzone
Copy link
Contributor Author

Hi @jianjuns I changed a little bit for MC doc, Could you review again? thanks.

Copy link
Contributor

@jianjuns jianjuns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove on-prem, public, etc. from the diagrams.

docs/multicluster/user-guide.md Outdated Show resolved Hide resolved
docs/multicluster/user-guide.md Outdated Show resolved Hide resolved
docs/multicluster/user-guide.md Outdated Show resolved Hide resolved
docs/multicluster/user-guide.md Outdated Show resolved Hide resolved
docs/multicluster/user-guide.md Outdated Show resolved Hide resolved
@jianjuns
Copy link
Contributor

jianjuns commented Jun 1, 2022

@luolanzone : the current version of user guide looks too complex to follow. I think let us split the PR to two, one for architecture doc, one for user guide, and let me work together with you on the latter.

@luolanzone luolanzone force-pushed the mc-dp-docs branch 2 times, most recently from 9e04232 to a23f5a7 Compare June 9, 2022 07:40
@luolanzone luolanzone removed this from the Antrea v1.7 release milestone Jun 9, 2022
@luolanzone
Copy link
Contributor Author

@jianjuns I removed this PR from release v1.7, but could you help to review and check if it's Ok to merge in this release? thanks.

@luolanzone luolanzone changed the title Add docs about Multi-cluster Service connectivity Update MC architecture doc Jun 9, 2022
@@ -8,7 +8,7 @@ ClusterSet, and enforced in all member clusters.

The diagram below depicts a basic multi-cluster topology in Antrea.

<img src="assets/basic-topology.png" width="500" alt="Antrea Multi-cluster Topology">
<img src="assets/basic-topology.svg" width="500" alt="Antrea Multi-cluster Topology">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The picture is too small.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not use on-prem / public, etc. They are not popular terms with K8s.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@@ -8,7 +8,7 @@ ClusterSet, and enforced in all member clusters.

The diagram below depicts a basic multi-cluster topology in Antrea.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a basic Antrea Multi-cluster topology with one leader cluster and two member clusters.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@@ -57,7 +57,7 @@ and encapsulates them into ResourceImports.

## Service Export and Import

<img src="assets/resource-export-import-pipeline.png" width="800" alt="Antrea Multi-cluster Resource Export/Import Pipeline">
<img src="assets/resource-export-import-pipeline.svg" width="800" alt="Antrea Multi-cluster Resource Export/Import Pipeline">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The picture is a little small too (hard for me to read the texts).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the picture, consider:

  1. Endpoint -> Endpoints
  2. Monitor -> Watch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

will be responsible to forward all cross-clusters traffic from local cluster to other member clusters.
Below is the basic architecture for Antrea Multi-cluster Service network connectivity.

<img src="assets/mc-service-connectivity.svg" width="600" alt="Antrea Multi-cluster Service Connectivity">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, a little small.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove "node-a1" around the tunnel line?

A minor one - the color of Cluster C box looks too different from that of Cluster A B. Could we adjust the colors?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, node-a1 is added by mistake, it's fixed, and color is adjusted.

@@ -106,3 +108,52 @@ Multi-cluster admins can also specify certain ClusterNetworkPolicies to be repli
ClusterSet. The ACNP to be replicated should be created as a ResourceExport in the leader cluster, and
the resource export/import pipeline will ensure member clusters receive this ACNP spec to be replicated.
Each member cluster's Multi-cluster Controller will then create an ACNP in their respective clusters.

## Antrea Multi-cluster Service Connectivity
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel "Multi-cluster Service Connectivity" is not a good term for people to understand.

How about "Multi-cluster Gateway" or "Cross-cluster Connectivity".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename it to Multi-cluster Gateway"


## Antrea Multi-cluster Service Connectivity

Antrea Multi-cluster supports Service connectivity directly since 1.7.0. It introduces a new feature gate
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel no need to mention feature gate or particular component configurations in the architecture doc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

@@ -84,14 +84,16 @@ been created by the Importer earlier.

Antrea Multi-cluster Controller only supports Service of type ClusterIP at this moment. In
order to support multi-cluster Service access between member clusters, Antrea requires member
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably talk about the new behavior first, like:

"Since Antrea v1.7.0, Multi-cluster Gateways must be configured to support Multi-cluster Service access across member clusters, and Service CIDRs cannot overlap between clusters. Refer to xxx for more information. Before Antrea v1.7.0, Pod IPs must be directly reachable across clusters for Multi-cluster Service access, and Pod CIDRs cannot overlap between clusters.

@@ -84,14 +84,16 @@ been created by the Importer earlier.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel this section can be merged to the previous one. Probably just one section called "Antrea Multi-cluster Service", which first introduces what is Multi-cluster Service, and then the implementation, including Service export and import.

Please read your doc and make sure a reader with no knowledge on multi-cluster implementation can understand what you wrote.

Copy link
Contributor Author

@luolanzone luolanzone Jun 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pipeline is introduced first considering both MC Service and MC network policy depend on this, I will check how to refine it. thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refined the whole structure and some descriptions.

docs/multicluster/architecture.md Outdated Show resolved Hide resolved
@@ -8,7 +8,7 @@ ClusterSet, and enforced in all member clusters.

The diagram below depicts a basic multi-cluster topology in Antrea.

<img src="assets/basic-topology.png" width="500" alt="Antrea Multi-cluster Topology">
<img src="assets/basic-topology.svg" width="500" alt="Antrea Multi-cluster Topology">

Given a set of Kubernetes clusters, there will be a leader cluster and several member clusters.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An Antrea Multi-cluster ClusterSet includes a leader clusters and multiple member clusters.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -8,7 +8,7 @@ ClusterSet, and enforced in all member clusters.

The diagram below depicts a basic multi-cluster topology in Antrea.

<img src="assets/basic-topology.png" width="500" alt="Antrea Multi-cluster Topology">
<img src="assets/basic-topology.svg" width="500" alt="Antrea Multi-cluster Topology">

Given a set of Kubernetes clusters, there will be a leader cluster and several member clusters.
By default, a leader cluster itself is also a member cluster of a ClusterSet. A cluster
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why by default? Probably copy the description in user guide.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@luolanzone luolanzone force-pushed the mc-dp-docs branch 2 times, most recently from b7c1c0f to 9fc80ff Compare June 10, 2022 03:23
@jianjuns jianjuns changed the title Update MC architecture doc Update Multi-cluster architecture doc Jun 10, 2022
docs/multicluster/architecture.md Show resolved Hide resolved

<img src="assets/basic-topology.png" width="500" alt="Antrea Multi-cluster Topology">
<img src="assets/basic-topology.svg" width="650" alt="Antrea Multi-cluster Topology">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other diagrams use Cluster A/B/C. Probably we should change this one too to be consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Given a set of Kubernetes clusters, there will be a leader cluster and several member clusters.
By default, a leader cluster itself is also a member cluster of a ClusterSet. A cluster
can also be configured as a dedicated leader cluster of multiple ClusterSets.
An Antrea Multi-cluster ClusterSet includes a leader cluster and multiple member clusters.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel better to move this paragraph to be before line 9.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -32,35 +34,50 @@ interface for resource export/import that can be read/written by all member and
in the ClusterSet. The Common Area is implemented with a Namespace in the leader cluster for a
given ClusterSet.

## Antrea Multi-cluster Service

Since Antrea v1.7.0, Multi-cluster Gateways must be configured to support Multi-cluster Service
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section makes no sense to be here. And readers do not even know what is Multi-cluster Service from this doc so far.

Anyway, let us do some small adjustment in this PR, and revise later. Let us move this section to be after "Antrea Multi-cluster Controller". And in this section, let us first have the "Service Export and Import" sub-section; and add another sub-section called "Service Access Across Clusters", and move this paragraph there.

any extra setting.
## Antrea Multi-cluster Gateway

Antrea Multi-cluster supports Service connectivity directly since 1.7.0. User can choose one of K8s Nodes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Antrea started to support Multi-cluster Gateway since v1.7.0.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

An Antrea Multi-cluster ClusterSet includes a leader cluster and multiple 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.

## Terminology

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the following:

member of a ClusterSet with unique cluster ID, to claim a ClusterSet with unique ClusterSet ID.

with a unique cluster ID

and to claim a ClusterSet with a unique ClusterSet ID.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be more natural to talk about ClusterSet first:

The ClusterClaim CRD is used to claim a ClusterSet with a unique ClusterSet ID, and to claim the cluster itself as a member of a ClusterSet with a unique cluster ID.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

validates the ClusterSet and Clusterclaim. For resource export/import, it watches ResourceExports
and encapsulates them into ResourceImports.

## Service Export and Import
### Service Export and Import
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant adding a section at the same level of "## Antrea Multi-cluster Controller" called "## Multi-cluster Controller Service", so the sections are like:

## Antrea Multi-cluster Controller
## Multi-cluster Controller Service
### Service Export and Import
### Service Access Across Clusters
## Multi-cluster Gateway
### Multi-cluster Service Traffic Walk
## Antrea Multi-cluster NetworkPolicy

What you think? BTW, I removed "Antrea" from a few section titles. I feel no need to repeat it in all places.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, I will refine it. thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose you mean ## Multi-cluster Service in the second item?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

docs/multicluster/architecture.md Outdated Show resolved Hide resolved
In a member cluster, Antrea Multi-cluster creates a Deployment that runs Antrea Multi-cluster
Controller which is responsible for exporting resource to and importing resource from a leader
cluster in a ClusterSet.
Antrea Multi-cluster Controller watches ClusterSet, ClutserClaim, Service, ServiceExport etc.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove "watches...". It is not more important than other responsibilities of MC Controller to mention first.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want, we can say "Antrea Multi-cluster Controller implements ClusterSet management and resource export/import in the ClusterSet".

Controller which is responsible for exporting resource to and importing resource from a leader
cluster in a ClusterSet.
Antrea Multi-cluster Controller watches ClusterSet, ClutserClaim, Service, ServiceExport etc.
It has different responsibilities in member and leader clusters.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In either a leader or a member cluster, Antrea Multi-cluster Controller is deployed with a Deployment of a single replica, but it takes different responsibilities in member and leader clusters.

In a leader cluster, Antrea Multi-cluster creates a Deployment that runs Antrea Multi-cluster
Controller which is responsible for converting resources from different member clusters into one
encapsulated resource as long as these resources have the same kind and match Namespace sameness.
In a member cluster, Antrea Multi-cluster creates a Deployment with one replica that runs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel we can remove this paragraph, as resource export/import is talked in a later one too.


In ClusterSet initialization, Antrea Multi-cluster Controller in a member cluster watches
In a leader cluster, Antrea Multi-cluster creates a Deployment with one replica that runs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

member clusters into one encapsulated resource as long as these resources have the same kind
and match Namespace sameness.

When ClusterSet is initialized in member cluster, Antrea Multi-cluster Controller watches
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a sub-section of "ClusterSet Initialization"

and writes the ResourceExports to leader cluster. For resource importing, it watches ResourceImports
from leader cluster, and creates multi-cluster Services and Endpoints with a prefix `antrea-mc-`
plus exported Service name, and also ServiceImports which have the same name as the Service name.
For resources exporting in the member cluster, Antrea Multi-cluster Controller watches ServiceExport,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section is not well organized. I feel harder to explain all my suggestion than just writing down what is in my mind. Probably let me push a version for you to review.

Copy link
Contributor

@jianjuns jianjuns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@luolanzone : I updated a version. Please review.

other member clusters through tunnels. The diagram below depicts Antrea
Mulit-cluster connectivity with Multi-cluster Gateways.

<img src="assets/mc-gateway.svg" width="800" alt="Antrea Multi-cluster Gateway">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use "pod-a/b/c" to be consistent with "node-a1", etc.?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, I will update it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jianjuns the change looks good to me overall, I changed a few minor descriptions and the line length for Antrea Multi-cluster NetworkPolicy section as well, you can move forward if you feel it's ready.

Update the Multi-cluster architecture doc with descriptions about
Multi-cluster Gateway, and change the diagrams' format from png to svg.

Signed-off-by: Lan Luo <[email protected]>
Co-authored-by: Jianjun Shen <[email protected]>
Comment on lines 52 to 54
ClusterSet and Clusterclaim CRs, and initializes the ClusterSet. It also validates
the MemberClusterAnnounce CR created by a member cluster and updates the member
cluster status to the ClusterSet.
Copy link
Contributor Author

@luolanzone luolanzone Jun 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the main one I updated, we have a webhook for MemberClusterAnnounce in leader cluster, so I used validates here, and admin is the one to add/update member clusters to ClusterSet, Controller will validate and update status only.

@jianjuns
Copy link
Contributor

/skip-all

@jianjuns jianjuns merged commit 56e9e4a into antrea-io:main Jun 14, 2022
jianjuns added a commit that referenced this pull request Jun 16, 2022
…#3899: Revise Multi-cluster Gateway descriptions in user docs (#3908)

* Update Multi-cluster architecture doc

Update the Multi-cluster architecture doc with descriptions about
Multi-cluster Gateway, and change the diagrams' format from png to svg.

Signed-off-by: Lan Luo <[email protected]>
Co-authored-by: Jianjun Shen <[email protected]>

* Revise Multi-cluster Gateway descriptions in user docs

Revise the descriptions about Multi-cluster Gateway configuration and
multi-cluster Services.
Add descriptions about the `gateway-ip` annotation.
Remove unnecessary descriptions about implementations from the user
documents.

Signed-off-by: Jianjun Shen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/multi-cluster Issues or PRs related to multi cluster.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants