From 1f21c13eacf8ff00152dc8db6a4d34ce45549173 Mon Sep 17 00:00:00 2001 From: Miles Garnsey <11435896+Miles-Garnsey@users.noreply.github.com> Date: Tue, 28 May 2024 16:38:25 +1000 Subject: [PATCH] Update README.md Co-authored-by: Alexander Dejanovski --- README.md | 2 +- .../en/install/local/multi-cluster-helm/_index.md | 2 +- .../install/local/multi-cluster-kustomize/_index.md | 2 +- docs/content/en/reference/multi-cluster/_index.md | 4 +++- .../en/tasks/data-plane-registration/_index.md | 11 ++++++++--- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index fd30f0fa5..257f3b406 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ This section needs to be moved elsewhere, probably a dedicated page of its own. ## Connecting to remote clusters The control plane needs to establish client connections to remote cluster where the data plane runs. Credentials are provided via a [kubeconfig](https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/) file that is stored in a Secret. That secret is then referenced via a `ClientConfig` custom resource. -A kubeconfig entry for a cluster hosted by a cloud provider with include an auth token for authenticated with the cloud provider. That token expires. If you use one of these kubeconfigs be aware that the operator will not be able to access the remote cluster once that token expires. For this reason it is recommended that you use the [here](https://github.com/k8ssandra/k8ssandra-client) script for configuring a connection to the remote cluster. This script is discussed in more detail in a later section. +A kubeconfig entry for a cluster hosted by a cloud provider with include an auth token for authenticated with the cloud provider. That token expires. If you use one of these kubeconfigs be aware that the operator will not be able to access the remote cluster once that token expires. For this reason it is recommended that you use the [k8ssandra-client](https://github.com/k8ssandra/k8ssandra-client) for configuring a connection to the remote cluster. --> ## Installing the operator diff --git a/docs/content/en/install/local/multi-cluster-helm/_index.md b/docs/content/en/install/local/multi-cluster-helm/_index.md index 95e96731f..cf13152a7 100644 --- a/docs/content/en/install/local/multi-cluster-helm/_index.md +++ b/docs/content/en/install/local/multi-cluster-helm/_index.md @@ -265,7 +265,7 @@ false ### Register the data plane to the control plane -[k8ssandra-client](https://github.com/k8ssandra/k8ssandra-client) is used to register data planes to control planes. It does this by installing a ClientConfig on the control plane. +[k8ssandra-client](https://github.com/k8ssandra/k8ssandra-client) is used to register data planes to control planes. It does this by creating a ClientConfig custom resource on the control plane and a secret with a kubeconfig entry providing access to the dataplane. **Note:** K8ssandra Operator restarts automatically whenever there is a change to a `ClientConfig` (a create, update, or delete operation). This restart is done in order to update connections to remote clusters. diff --git a/docs/content/en/install/local/multi-cluster-kustomize/_index.md b/docs/content/en/install/local/multi-cluster-kustomize/_index.md index 709391e6b..990a91a58 100644 --- a/docs/content/en/install/local/multi-cluster-kustomize/_index.md +++ b/docs/content/en/install/local/multi-cluster-kustomize/_index.md @@ -179,7 +179,7 @@ kubectl -n k8ssandra-operator get deployment k8ssandra-operator -o jsonpath='{.s [k8ssandra-client](https://github.com/k8ssandra/k8ssandra-client) is used to register data planes to control planes. It does this by installing a ClientConfig on the control plane. K8ssandra-client data plane registration is described [here]({{< relref "/tasks/data-plane-registration" >}}). -Here is a summary of what the script does: +Here is a summary of what the k8ssandra-client's `register` command does': * Get the k8ssandra-operator service account from the data plane cluster * Extract the service account token diff --git a/docs/content/en/reference/multi-cluster/_index.md b/docs/content/en/reference/multi-cluster/_index.md index ed2a9108c..7a7ea118d 100644 --- a/docs/content/en/reference/multi-cluster/_index.md +++ b/docs/content/en/reference/multi-cluster/_index.md @@ -167,4 +167,6 @@ Here is a brief summary of what the script does: * Extract the CA cert * Create a kubeconfig using the token and cert * Create a secret for the kubeconfig in the control plane custer -* Create a ClientConfig in the control plane cluster that references the secret. \ No newline at end of file +* Create a ClientConfig in the control plane cluster that references the secret. + +See [here]({{< relref "/tasks/data-plane-registration" >}}) for more information on the dataplane registration procedure. \ No newline at end of file diff --git a/docs/content/en/tasks/data-plane-registration/_index.md b/docs/content/en/tasks/data-plane-registration/_index.md index 07c3090c4..415d09fcf 100644 --- a/docs/content/en/tasks/data-plane-registration/_index.md +++ b/docs/content/en/tasks/data-plane-registration/_index.md @@ -11,12 +11,17 @@ Details of the multi-cluster connectivity architecture can be found [here]({{< r Proceed with caution before deleting a ClientConfig or the secrets backing it. If there are any K8ssandraClusters that use the kube config provided by the ClientConfig, then the operator won't be able to properly manage them. #### Creating a ClientConfig and Kubeconfig secret -Registering a data plane to a control plane can be error prone if done by hand. Instead use the `k8ssandra-client` CLI tool which can be found [here](https://github.com/k8ssandra/k8ssandra-client). It can be installed as a kubectl plugin by placing it on your `$PATH` or run completely separately. +Registering a data plane to a control plane can be error prone if done by hand. Instead use the `k8ssandra-client` CLI tool which can be found [here](https://github.com/k8ssandra/k8ssandra-client). It can be installed as a kubectl plugin by placing it on your `$PATH` (invoked with `kubectl k8ssandra ...`) or run completely separately (invoked with `./kubectl-k8ssandra ...`). -An example command to register a data plane to a control plane would be `./kubectl-k8ssandra register --source-context gke_k8ssandra_us-central1-c_registration-2 --dest-context gke_k8ssandra_us-central1-c_registration-1` where the source context (`gke_k8ssandra_us-central1-c_registration-2`) is the data plane (because that's the source of the credentials) and the destination context (`gke_k8ssandra_us-central1-c_registration-1`) is the control plane. +An example command to register a data plane to a control plane would be `kubectl k8ssandra register --source-context gke_k8ssandra_us-central1-c_registration-2 --dest-context gke_k8ssandra_us-central1-c_registration-1` where the source context (`gke_k8ssandra_us-central1-c_registration-2`) is the data plane (because that's the source of the credentials) and the destination context (`gke_k8ssandra_us-central1-c_registration-1`) is the control plane. + +If the operator was installed in a different namespace than `k8ssandra-operator` in either the source or the destination cluster, use the following flags to indicate the actual namespaces: + +- `--dest-namespace ` +- `--source-namespace ` A full list of options for this command can be found by using the `--help` flag. #### Referencing a remote data plane within a K8ssandraCluster -Within the K8ssandraCluster DC list, the k8sContext can be used to reference a remote data plane. When creating ClientConfigs using k8ssandra-client, you will find that you can simply refer to the data plane using the name of the ClientConfig. However, if the ClientConfig has been created by hand, the ClientConfig contextName and meta.name may be different, in which case the contextName should be used. We recommend using k8ssandra-client to register data planes due to complexities like these. \ No newline at end of file +Within the K8ssandraCluster DC list, the k8sContext can be used to reference a remote data plane. When creating ClientConfigs using k8ssandra-client, you will find that you can simply refer to the data plane using the name of the ClientConfig resource. However, if the ClientConfig has been created by hand, the ClientConfig `spec.contextName` and `meta.name` may be different, in which case the `spec.contextName` should be used. We recommend using k8ssandra-client to register data planes due to complexities like these. \ No newline at end of file