Antctl Multi-cluster commands

    • antctl mc get resourceimport (or get resourceimports, get ri) command can print all ResourceImports, a specified ResourceImport, or ResourceImports in a specified Namespace.
    • antctl mc get resourceexport (or get resourceexports, ) command can print all ResourceExports, a specified ResourceExport, ResourceExports in a specified Namespace, or ResourceExports in a specific member cluster.

    Using the json or yaml antctl output format can print more information of ClusterSet, ResourceImport, and ResourceExport than using the default table output format.

    To see the usage examples of these commands, you may also run antctl mc get [subcommand] --help.

    antctl mc create

    antctl mc create command can create tokens for member clusters to join a ClusterSet. The command will also create a Secret to store the token, as well as a ServiceAccount and a RoleBinding. The --output-file option saves the member token Secret manifest to a file.

    1. anctcl mc create membertoken NAME -n NAMESPACE [-o OUTPUT_FILE]

    antctl mc deploy command deploys Antrea Multi-cluster Controller to a leader or member cluster.

    • antctl mc deploy leadercluster command deploys Antrea Multi-cluster Controller to a leader cluster and imports all the Antrea Multi-cluster CRDs.
    • antctl mc deploy membercluster command deploys Antrea Multi-cluster Controller to a member cluster and imports all the Antrea Multi-cluster CRDs.

    To see the usage examples of these commands, you may also run antctl mc deploy [subcommand] --help.

    antctl mc init

    antctl mc init command initializes an Antrea Multi-cluster ClusterSet in a leader cluster. It will create a ClusterSet and ClusterClaims for the leader cluster. If the --output-file option is specified, the config arguments for member clusters to join the ClusterSet will be saved to the specified file.

    1. antctl mc init -n NAMESPACE --clusterset CLUSTERSET_ID --clusterid CLUSTERID [--create-token] [-o OUTPUT_FILE]

    antctl mc join command lets a member cluster join an existing Antrea Multi-cluster ClusterSet. It will create a ClusterSet and ClusterClaims for the member cluster. Users can use command line options or a config file (which can be the output file of the anctl mc init command) to specify the ClusterSet join arguments.

    When the config file is provided, the command line options may be overridden by the file. A token is needed for a member cluster to access the leader cluster API server. Users can either specify a pre-created token Secret with the --token-secret-name option, or pass a Secret manifest to create the Secret with either the --token-secret-file option or the config file.

    Below is a config file example:

    1. apiVersion: multicluster.antrea.io/v1alpha1
    2. clusterSetID: clusterset1
    3. clusterID: cluster-east
    4. namespace: kube-system
    5. leaderClusterID: cluster-north
    6. leaderNamespace: antrea-multicluster
    7. leaderAPIServer: https://172.18.0.3:6443
    8. tokenSecretName: cluster-east-token

    antctl mc leave

    command can destroy an Antrea Multi-cluster ClusterSet in a leader cluster. It will delete the ClusterSet and ClusterClaims and other resources created by antctl for the leader cluster.