Skip to content

Add database configurations to registry chart

João Pereira requested to merge 2565-add-database-configurations into master

What does this MR do?

This MR introduces the required configurations to enable and setup the container registry metadata database.

Values used for testing:

registry:
  database:
    enabled: true
    password:
      secret: gitlab-postgresql-password
      key: postgresql-registry-password
    name: registry
    sslmode: verify-full
    ssl:
      secret: gitlab-registry-postgresql-ssl
      clientKey: client-key.pem
      clientCertificate: client-cert.pem
      serverCA: server-ca.pem

Secrets:

kubectl create secret generic gitlab-postgresql-password \
  --from-literal=postgresql-password=(head -c 512 /dev/urandom | LC_CTYPE=C tr -cd 'a-zA-Z0-9' | head -c 64) \
  --from-literal=postgresql-postgres-password=(head -c 512 /dev/urandom | LC_CTYPE=C tr -cd 'a-zA-Z0-9' | head -c 64) \
  --from-literal=postgresql-registry-password=(head -c 512 /dev/urandom | LC_CTYPE=C tr -cd 'a-zA-Z0-9' | head -c 64)

kubectl create secret generic gitlab-registry-postgresql-ssl \
  --from-file=client-key.pem=./tmp/client-key.pem \
  --from-file=client-cert.pem=./tmp/client-cert.pem \
  --from-file=server-ca.pem=./tmp/server-ca.pem

Related issues

Related to #2565.

Changes per 2565

  1. Configuration added (https://gitlab.com/gitlab-org/container-registry/-/blob/master/docs/configuration.md#database)
  2. Additional secret added, and populated through configure
  3. [ ] initContainer added, post configure, as dependencies when database enabled moved to !1857 (merged)
  4. Update NOTES.txt to include Warning that this feature is experimental, and not for production use.

Checklist

See Definition of done.

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

Required

  • Merge Request Title and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com

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
  • Equivalent MR/issue for omnibus-gitlab opened

Closes #2565

Edited by Jason Plum

Merge request reports