Add Knowledge Graph secret generation in Omnibus

What does this MR do?

Adds proper support for Orbit / Knowledge Graph to the Omnibus package. Previously only CNG had proper support for Orbit; Omnibus installations required editing scripts on the machine.

New user-facing settings (documented in gitlab.rb.template):

  • gitlab_rails['knowledge_graph_enabled']
  • gitlab_rails['knowledge_graph_grpc_endpoint'] (default localhost:50054)
  • gitlab_rails['knowledge_graph_secret'] (auto-generated when unset)
Implementation details

Secret format and location. The secret is base64 of 32 random bytes, identical to the KAS api_secret_key, matching what Gitlab::JwtAuthenticatable expects on the Rails side (HS256, audience gitlab-knowledge-graph). It is persisted to gitlab-secrets.json and written to /var/opt/gitlab/gitlab-rails/etc/gitlab_knowledge_graph_secret (mode 0644, matching every other rails-root secret dotfile), symlinked to .gitlab_knowledge_graph_secret in the Rails root. That file path is what an operator copies into the Orbit Kubernetes secret store.

Behaviour. The secret is always generated and managed regardless of enabled, same as KAS/Shell/Workhorse. A user-provided value is validated to be exactly 32 bytes at reconfigure time. The knowledge_graph stanza is rendered unconditionally in gitlab.yml; the Rails app gates it behind Gitlab.ee.

Rails references. JWT auth MR gitlab!224386 (merged); boot-crash incident gitlab#591610 (closed); graceful-handling fixes gitlab!225107 (merged) and gitlab!229088 (merged).

Closes #9718 (closed)

Documentation follow-up for the secret hand-off: #10026

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion.

Required

  • MR title and description are up to date, accurate, and descriptive.
  • MR targeting the appropriate branch.
  • Latest Merge Result pipeline is green.
  • When ready for review, MR is labeled workflowready for review per the Distribution MR workflow.
  • The UBT version and corresponding checksum hash have been updated and referenced in the merge request if applicable.
    • UBT EE pipeline (Trigger:ee-package-ubt) is green
    • Not applicable: no UBT version change.

For GitLab team members

If you don't have access to this, the reviewer should trigger these jobs for you during the review process.

  • The manual Trigger:ee-package jobs have a green pipeline running against latest commit.
  • If config/software or config/patches directories are changed, make sure the build-package-on-all-os job within the Trigger:ee-package downstream pipeline succeeded.
    • Not applicable: no changes under config/software or config/patches.
  • If you are changing anything SSL related, then the Trigger:package:fips manual job within the Trigger:ee-package downstream pipeline must succeed.
    • Not applicable: no SSL-related changes.
  • If CI configuration is changed, the branch must be pushed to dev.gitlab.org to confirm regular branch builds aren't broken.
    • Not applicable: no CI configuration changes.

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes.
  • Documentation created/updated.
  • Tests added.
  • Integration tests added to GitLab QA.
    • Not applicable: covered by ChefSpec; no QA scenario for Knowledge Graph yet.
  • Equivalent MR/issue for the GitLab Chart opened.
  • Validate potential values for new configuration settings. Formats such as integer 10, duration 10s, URI scheme://user:passwd@host:port may require quotation or other special handling when rendered in a template and written to a configuration file.
Edited by João Alexandre Cunha

Merge request reports

Loading