Using the Shared-Secrets Job
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed
The shared-secrets job is responsible for provisioning a variety of secrets
used across the installation, unless otherwise manually specified. This includes:
- Initial root password
- Self-signed TLS certificates for all public services: GitLab, Registry, KAS, and GitLab Pages
- Registry authentication certificates
- Registry, GitLab Shell, and Gitaly secrets
- SSH host keys
- GitLab Rails secret for encrypted credentials
Installation command line options
The table below contains all the possible configurations that can be supplied to
the helm install command using the --set flag:
| Parameter | Default | Description |
|---|---|---|
enabled | true | See Below |
env | production | Rails environment |
provider | job | See Below |
podLabels | Supplemental Pod labels. Will not be used for selectors. | |
annotations | Supplemental Pod annotations. | |
image.pullPolicy | Always | DEPRECATED: Use global.kubectl.image.pullPolicy instead. |
image.pullSecrets | DEPRECATED: Use global.kubectl.image.pullSecrets instead. | |
image.repository | registry.gitlab.com/gitlab-org/build/cng/kubectl | DEPRECATED: Use global.kubectl.image.repository instead. |
image.tag | 1f8690f03f7aeef27e727396927ab3cc96ac89e7 | DEPRECATED: Use global.kubectl.image.tag instead. |
priorityClassName | Priority class assigned to pods | |
rbac.create | true | Create RBAC roles and bindings |
resources | resource requests, limits | |
securityContext.fsGroup | 65534 | User ID to mount filesystems as |
securityContext.runAsUser | 65534 | User ID to run the container as |
selfsign.caSubject | GitLab Helm Chart | selfsign CA Subject |
selfsign.image.repository | registry.gitlab.com/gitlab-org/build/cnf/cfssl-self-sign | selfsign image repository |
selfsign.image.pullSecrets | Secrets for the image repository | |
selfsign.image.tag | selfsign image tag | |
selfsign.keyAlgorithm | rsa | selfsign cert key algorithm |
selfsign.keySize | 4096 | selfsign cert key size |
serviceAccount.enabled | true | Define serviceAccountName on job(s) |
serviceAccount.create | true | Create ServiceAccount |
serviceAccount.name | RELEASE_NAME-shared-secrets | Service account name to specify on job(s) (and on the serviceAccount itself if serviceAccount.create=true) |
tolerations | [] | Toleration labels for pod assignment |
Job configuration examples
tolerations
tolerations allow you schedule pods on tainted worker nodes
Below is an example use of tolerations:
tolerations:
- key: "node_label"
operator: "Equal"
value: "true"
effect: "NoSchedule"
- key: "node_label"
operator: "Equal"
value: "true"
effect: "NoExecute"Select a provisioning backend
provider selects what provisions the secrets. Keep the default value, job. A
pre-install and pre-upgrade hook job then generates the secrets.
job is the only supported value. Other values are reserved for internal use, are not
supported, and are not intended to be set. Do not change provider unless you know what
you are doing.
Setting a secret value such as global.gitaly.authToken.secret changes which Secret the
chart uses. The job still generates that Secret, as described in
How the job treats existing secrets.
Generated secrets are not owned by the Helm release, so helm uninstall does not remove
them. For more information, see uninstall.
How the job treats existing secrets
The job runs on every install and upgrade. It never rotates a value.
- If a Secret does not exist, the job creates it with every key.
- If a Secret exists, the job keeps every value in it. It adds a missing key only if the
job passes that key to
kubectlas a literal. Every token and password is a literal. - The job never adds a missing key to a Secret it builds from files. If one of these
Secrets exists, the job leaves it unchanged, even if a key is missing:
- The registry authentication certificate,
registry-auth.crtandregistry-auth.key. - The GitLab Shell SSH host keys.
- The AI Gateway signing and validation keys.
- The OpenBao static unseal key.
- The registry authentication certificate,
- If every Secret and key exists, the job changes no value. It still applies its labels to
every Secret, and it writes the Rails
secrets.ymlback with the same content.
The Rails secret is the exception. The job reads its secrets.yml and keeps every field
the chart generates that has a value. It generates each of those fields that is missing,
null, or empty. Then it writes the whole document back. The new document holds only the
fields the chart generates, under the environment set in env. The job drops every other
field, and the blocks of every other environment. It keeps a list as it is, so a rotated
active_record_encryption_primary_key survives.
Disable functionality
Some users may wish to explicitly disable the functionality provided by this job.
To do this, we have provided the enabled flag as a boolean, defaulting to true.
To disable the job, pass --set shared-secrets.enabled=false, or pass the following
in a YAML via the -f flag to helm:
shared-secrets:
enabled: falseIf you disable this job, you must manually create all secrets, and provide all necessary secret content. See installation/secrets for further details.
enabled: false disables provisioning entirely.
To add a new generated secret to the chart, see Add a generated secret.