设置全局数据库密钥
REAADB 包含字段 '.spec.globalConfigurations' 以设置全局数据库密钥。
| 适用于 Kubernetes 的 Redis Enterprise |
|---|
注意:
此功能在 6.4.2-6 及更高版本中正式发布受支持。其中一些功能在 6.4.2-4 和 6.4.2-5 中作为预览版提供。请升级到 6.4.2-6 以获取完整的正式发布功能和错误修复。设置全局数据库密钥
可用于的字段之一globalConfigurations是databaseSecretName它可以指向包含数据库密码的密钥。要设置数据库密钥名称并将数据同步到所有参与的集群,请执行以下步骤。
要编辑其他全局配置,请参阅 全局配置
- 在现有的参与集群上,生成一个 YAML 文件,其中包含具有数据库密码的数据库密钥。
此示例使用名为my-db-secret替换为my-password以 base 64 编码。
apiVersion: v1
data:
password: bXktcGFzcw
kind: Secret
metadata:
name: my-db-secret
type: Opaque
-
Apply the secret file from the previous step, substituting your own value for
<db-secret-file>.kubectl apply -f <db-secret-file> -
Patch the REAADB custom resource to specify the database secret, substituting your own values for
<reaadb-name>and<secret-name>.kubectl patch reaadb <reaadb-name> --type merge --patch \ '{"spec": {"globalConfigurations": {"databaseSecretName": "secret-name"}}}' -
Check the REAADB status for an
activestatus andValidspec status.kubectl get reaadb <reaadb-name> NAME STATUS SPEC STATUS GLOBAL CONFIGURATIONS REDB LINKED REDBS example-aadb-1 active Valid -
On each other participating cluster, check the secret status.
``sh kubectl get reaadb
-o=jsonpath='{.status.secretsStatus}' The output should show the status as `Invalid`. ```sh [{"name":"my-db-secret","status":"Invalid"}] -
Sync the secret on each participating cluster.
kubectl apply -f <db-secret-file> -
Repeat the previous two steps on every participating cluster.
On this page