From 48bbe9a4cecf391fd15a0032e40d7e5602442dec Mon Sep 17 00:00:00 2001 From: RainbowMango Date: Wed, 12 Jan 2022 15:33:36 +0800 Subject: [PATCH] Improve register document Signed-off-by: RainbowMango --- docs/userguide/cluster-registration.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/userguide/cluster-registration.md b/docs/userguide/cluster-registration.md index 74e6633073c9..8315cc42b456 100644 --- a/docs/userguide/cluster-registration.md +++ b/docs/userguide/cluster-registration.md @@ -47,13 +47,22 @@ kubectl karmada join member1 --kubeconfig= --cluster-kubecon ``` Repeat this step to join any additional clusters. -The `--kubeconfig` specifies the Karmada's `kubeconfig` file and the `--cluster-kubeconfig` specifies the registering cluster's `kubeconfig` file. +The `--kubeconfig` specifies the Karmada's `kubeconfig` file and the CLI infers `karmada-apiserver` context +from the `current-context` field of the `kubeconfig`. If there are more than one context is configured in +the `kubeconfig` file, it is recommended to specify the context by the `--karmada-context` flag. For example: +``` +kubectl karmada join member1 --kubeconfig= --karmada-context=karmada --cluster-context=member1 +``` + +The `--cluster-kubeconfig` specifies the member cluster's `kubeconfig` and the CLI infers the member cluster's context +by the cluster name. If there is more than one context is configured in the `kubeconfig` file, or you don't want to use +the context name to register, it is recommended to specify the context by the `--cluster-context` flag. For example: -Maybe you have to specify the context if there are more than one contexts in `kubeconfig` file: ``` kubectl karmada join member1 --kubeconfig= --karmada-context=karmada \ --cluster-kubeconfig= --cluster-context=member1 ``` +> Note: The registering cluster name can be different from the context with `--cluster-context` specified. ### Check cluster status