content/operate/kubernetes/7.8.6/active-active/edit-clusters.md
{{<note>}}This feature is supported for general availability in releases 6.4.2-6 and later. Some of these features were available as a preview in 6.4.2-4 and 6.4.2-5. Please upgrade to 6.4.2-6 for the full set of general availability features and bug fixes. and later.{{</note>}}
Use the following steps to add a participating cluster to an existing Redis Enterprise Active-Active database (REAADB) for Kubernetes.
To prepare the Redis Enterprise cluster (REC) to participate in an Active-Active database, perform the following tasks from [Prepare participating clusters]({{< relref "/operate/kubernetes/7.8.6/active-active/prepare-clusters.md" >}}):
ValidatingWebhookConfiguration.To communicate with other clusters, all participating clusters need access to the admin credentials for all other clusters.
Get the REC credentials secret for the new participating cluster.
kubectl get secret -o yaml <rec-name>
This example shows an admin credentials secret for an REC named rec-boston:
apiVersion: v1
data:
password: ABcdef12345
username: GHij56789
kind: Secret
metadata:
name: rec-boston
type: Opaque
Create a secret for the new participating cluster named redis-enterprise-<rerc> and add the username and password.
The example below shows a secret file for a remote cluster named rerc-logan .
apiVersion: v1
data:
password: ABcdef12345
username: GHij56789
kind: Secret
metadata:
name: redis-enterprise-rerc-logan
type: Opaque
Apply the file of collected secrets to every participating REC.
kubectl apply -f <rec-secret-file>
If the admin credentials for any of the clusters change, update and reapply the file to all clusters.
From one of the existing participating clusters, create a RedisEnterpriseRemoteCluster (RERC) custom resource for the new participating cluster.
This example shows an RERC custom resource for an REC named rec-boston in the namespace ns-massachusetts.
apiVersion: app.redislabs.com/v1alpha1
kind: RedisEnterpriseRemoteCluster
metadata:
name: rerc-logan
spec:
recName: rec-boston
recNamespace: ns-massachusetts
apiFqdnUrl: test-example-api-rec-boston-ns-massachusetts.example.com
dbFqdnSuffix: -example-cluster-rec-boston-ns-massachusetts.example.com
secretName: redis-enterprise-rerc-logan
Create the RERC custom resource.
kubectl create -f <new-RERC-file>
Check the status of the newly created RERC custom resource.
kubectl get rerc <RERC-name>
The output should look like this:
NAME STATUS SPEC STATUS LOCAL
rerc-logan Active Valid true
Patch the REAADB spec to add the new RERC name to the participatingClusters, replacing <reaadb-name> and <rerc-name> with your own values.
kubectl patch reaadb <reaadb-name> < --type merge --patch '{"spec": {"participatingClusters": [{"name": "<rerc-name>"}]}}'
View the REAADB participatingClusters status to verify the cluster was added.
kubectl get reaadb <reaadb-name> -o=jsonpath='{.status.participatingClusters}'
The output should look like this:
[{"id":1,"name":"rerc-ohare"},{"id":2,"name":"rerc-reagan"},{"id":3,"name":"rerc-logan"}]
On an existing participating cluster,remove the desired cluster from the participatingCluster section of the REAADB spec.
kubectl edit reaadb <reaadb-name>
On each of the other participating clusters, verify the status is active and the spec status is Valid and the cluster was removed.
kubectl get reaadb <reaadb-name -o=jasonpath=`{.status}`
The output should look like this:
{... ,"participatingClusters":[{"id":1,"name":"rerc1"},{"id":2,"name":"rerc2"}],"redisEnterpriseCluster":"rec1","specStatus":"Valid","status":"active"}
On the removed participating cluster, list all REAADB resources on the cluster to verify they were deleted.
kubectl get reaadb -o+jasonpath=`{range.items[*]}{.metadata.name}`