如何自定义 Rails 密钥

首先设置以下环境变量:

export NEW_GITLAB_NAMESPACE=<namespace of the new GitLab instance>
export NEW_GITLAB_NAME=<name of the new GitLab instance>

将 Rails 密钥保存到本地的 secrets.yml 文件中。

示例:

# Create the file
cat > secrets.yml <<EOF
production:
  secret_key_base: ...
  otp_key_base: ...
  ...
EOF

将 Rails 密钥保存到 Kubernetes Secret:

kubectl create secret generic rails-secret -n ${NEW_GITLAB_NAMESPACE} --from-file=secrets.yml

更新 GitLab 实例配置:

kubectl edit gitlabofficial ${NEW_GITLAB_NAME} -n ${NEW_GITLAB_NAMESPACE}

将以下 spec 配置添加到 CR:

spec:
  helmValues:
    global:
      railsSecrets:
        secret: rails-secret

等待实例完成重新部署。


GitLab 是 GitLab Inc. 的商标。

Alauda 是独立供应商。本产品与 GitLab Inc. 无关联,也未获得其认可或赞助。所有商标均为其各自所有者的财产,此处仅用于标识目的。