Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Dejanovski <[email protected]>
  • Loading branch information
Miles-Garnsey and adejanovski committed May 28, 2024
1 parent 451e602 commit 1f21c13
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/install/local/multi-cluster-helm/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion docs/content/en/reference/multi-cluster/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
* 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.
11 changes: 8 additions & 3 deletions docs/content/en/tasks/data-plane-registration/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <namespace>`
- `--source-namespace <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.
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.

0 comments on commit 1f21c13

Please sign in to comment.