{
  "id": "global-db-secret",
  "title": "Set global database secret",
  "url": "https://redis.io/docs/latest/operate/kubernetes/7.8.4/active-active/global-db-secret/",
  "summary": "The REAADB contains the field '.spec.globalConfigurations' to set the global database secret.",
  "content": "\n\n## Set global database secret\n\nOne of the fields available for `globalConfigurations` is `databaseSecretName` which can point to a secret containing the database password. To set the database secret name and sync the data to all participating clusters, follow the steps below.\n\nTo edit other global configruations, see [global configuration]()\n\n1. On an existing participating cluster, generate a YAML file containing the database secret with the database password.\n\n  This example shoes a secret named `my-db-secret` with the password `my-password` encoded in base 64.\n\n  ```yaml\n  apiVersion: v1\n  data:\n    password: bXktcGFzcw\n  kind: Secret\n  metadata:\n    name: my-db-secret\n  type: Opaque\n  ```\n\n1. Apply the secret file from the previous step, substituting your own value for `\u003cdb-secret-file\u003e`.\n\n    ```sh\n    kubectl apply -f \u003cdb-secret-file\u003e\n    ```\n\n1. Patch the REAADB custom resource to specify the database secret, substituting your own values for `\u003creaadb-name\u003e` and `\u003csecret-name\u003e`.\n\n    ```sh\n    kubectl patch reaadb \u003creaadb-name\u003e --type merge --patch \\\n    '{\"spec\": {\"globalConfigurations\": {\"databaseSecretName\": \"secret-name\"}}}'\n    ```\n\n1. Check the REAADB status for an `active` status and `Valid` spec status.\n\n    ```sh\n    kubectl get reaadb \u003creaadb-name\u003e\n\n    NAME             STATUS   SPEC STATUS   GLOBAL CONFIGURATIONS REDB   LINKED REDBS\n    example-aadb-1   active   Valid\n    ```\n\n1. On each other participating cluster, check the secret status.\n\n    ``sh\n    kubectl get reaadb \u003creaadb-name\u003e -o=jsonpath='{.status.secretsStatus}'\n    ```\n\n    The output should show the status as `Invalid`.\n\n    ```sh\n    [{\"name\":\"my-db-secret\",\"status\":\"Invalid\"}]\n    ```\n\n1. Sync the secret on each participating cluster.\n\n    ```sh\n    kubectl apply -f \u003cdb-secret-file\u003e\n    ```\n\n1. Repeat the previous two steps on every participating cluster.\n",
  "tags": ["docs","operate","kubernetes"],
  "last_updated": "2026-04-08T12:21:52-07:00"
}

