我正在尝试使用Bitnami Redis HELM Chart在 Kubernetes 环境中安装 Redis 。我想使用定义的密码而不是随机生成的密码。但是当我想使用 redis-cli 连接到 redis master 或副本时,出现以下错误。
I have no name!@redis-client:/$ redis-cli -h redis-master -a $REDIS_PASSWORD
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
Warning: AUTH failed
Run Code Online (Sandbox Code Playgroud)
我创建了一个像这样的 Kubernetes 秘密。
---
apiVersion: v1
kind: Secret
metadata:
name: redis-secret
namespace: redis
type: Opaque
data:
redis-password: YWRtaW4xMjM0Cg==
Run Code Online (Sandbox Code Playgroud)
在values.yaml 文件中,我更新了身份验证规范,如下所示。
auth:
enabled: true
sentinel: false
existingSecret: "redis-secret"
existingSecretPasswordKey: "redis-password"
usePasswordFiles: false
Run Code Online (Sandbox Code Playgroud)
如果我不定义existingSecret字段并使用随机生成的密码,那么我可以毫无问题地连接。AUTH admin1234 …