Kubernetes 设置gitlab初始根密码-gitlab Helm图表
我正在使用在集群上安装Gitlab。我想设置initialRootPassword,这样我就可以登录而不必执行kubectl get secretKubernetes 设置gitlab初始根密码-gitlab Helm图表,kubernetes,gitlab,kubernetes-helm,helmfile,Kubernetes,Gitlab,Kubernetes Helm,Helmfile,我正在使用在集群上安装Gitlab。我想设置initialRootPassword,这样我就可以登录而不必执行kubectl get secret ## Initial root password for this GitLab installation ## Secret created according to doc/installation/secrets.md#initial-root-password ## If allowing shared-secrets gener
## Initial root password for this GitLab installation
## Secret created according to doc/installation/secrets.md#initial-root-password
## If allowing shared-secrets generation, this is OPTIONAL.
initialRootPassword: {}
# secret: RELEASE-gitlab-initial-root-password
# key: password
上面的代码块有点混乱。你能帮我做这个吗?谢谢。initialRootPassword引用了kubernetes中的一个对象,因此您必须首先在与gitlab实例相同的命名空间中创建一个秘密,然后将initialRootPassword指向它 例如,如果希望根密码为“password”,首先需要对其进行base64编码
$ echo -n "password"|base64
cGFzc3dvcmQ=
然后将其添加到kubernetes
# secret.yaml
apiVersion: v1
kind: Secret
metadata:
name: gitlab-root-password
data:
password: cGFzc3dvcmQ=
还有其他方法来创造这个秘密,更多信息
然后可以设置initialRootPassword
initialRootPassword:
secret: gitlab-root-password
key: password
这里的密钥是指机密对象中数据密钥的名称
另一种方法是使用Gitlab,它允许您创建一个秘密对象,该对象将在不显式设置initialRootPassword的情况下自动使用
initialRootPassword:
secret: gitlab-root-password
key: password
此示例取自(用发布名称替换
)
kubectl create secret generic-gitlab初始根密码-from literal=password=$(head-c 512/dev/uradom | LC_CTYPE=c tr-cd'a-zA-Z0-9'| head-c 32)
kubectl create secret generic <name>-gitlab-initial-root-password --from-literal=password=$(head -c 512 /dev/urandom | LC_CTYPE=C tr -cd 'a-zA-Z0-9' | head -c 32)