Add Artifact Registry configuration for hybrid deployments
What does this MR do?
Adds gitlab.rb configuration that lets operators point GitLab Rails at an
Artifact Registry service running separately from the Linux package.
Artifact Registry is not installed or packaged by the Linux package, and this MR does not change that. It is for hybrid deployments only: GitLab Rails runs on a Linux package installation, and Artifact Registry runs as its own service elsewhere. This gap was identified in charts!5294 (comment): AR is not packaged, but Rails still needs to be configured to reach it.
New settings
gitlab_rails['artifact_registry_api_url'] = 'https://artifact-registry.example.com'
gitlab_rails['artifact_registry_service_token_file'] = '/etc/gitlab/artifact-registry/.gitlab_artifact_registry_secret'These render into gitlab.yml as the stanza GitLab Rails reads:
artifact_registry:
api_url: "https://artifact-registry.example.com"
service_token:
secret_file: "/etc/gitlab/artifact-registry/.gitlab_artifact_registry_secret"matching the Rails settings added in
gitlab!252017 (merged)
(Settings.artifact_registry.api_url and the nested
Settings.artifact_registry.service_token['secret_file']).
Behavior
- The whole
artifact_registry:block renders only whenartifact_registry_api_urlis set. An install that sets neither key renders no stanza and connects to no service. service_token.secret_filerenders only when the token file key is set. An install may setapi_urlalone; the Rails service path then fails closed (no credential) while the per-user path is unaffected.- The token file is operator-supplied. The Linux package does not create, generate, or manage it, and does not mint the token.
Implementation notes
- The keys are flat
gitlab_rails['artifact_registry_*']attributes, mirroring the existinggitlab_rails['gitlab_kas_*']block. The recipe needs no change becausegitlab-rails.rbalready splatsnode['gitlab']['gitlab_rails'].to_hashinto the template. The nestedservice_token.secret_fileshape lives in thegitlab.yml.erbtemplate, not in the input key name.
Related issues
Closes #10080 (closed)
Related:
- https://gitlab.com/gitlab-org/gitlab/-/issues/617724 (Rails settings keys)
- gitlab!252017 (merged) (Rails implementation)
- gitlab-org/charts/gitlab!5294 (merged) (Helm chart equivalent)
Test plan
spec/chef/cookbooks/gitlab/recipes/gitlab-rails_spec.rb covers the rendered
gitlab.yml across four states: neither key set (no stanza), api_url only
(no service_token), both set (nested service_token.secret_file), and token
file without api_url (no stanza). All four pass.