Drop the configure init container from Toolbox
What does this MR do?
Third step of the plan in #6745: remove the configure init container from the Toolbox Deployment and its backup and database reindex CronJobs. It uses the same approach as !5560 (merged) and !5562 (merged), which are merged.
Goal
- Drop the
configurecontainer that neededgitlab-base. Theconfigureinit container runs a shell script from thegitlab-baseimage. Without it, the Toolbox Pods no longer need thegitlab-baseimage. - No copy at Pod start. The init container copied the Secrets into an
emptyDironce, at Pod start. The main containers now read the projected volume directly. Settings rendered at container start keep their values, so restart the Pods after you change the Secrets.
Before and after
flowchart LR
subgraph before["Before"]
direction LR
S1["Secrets and<br/>ConfigMaps"] --> P1["projected volume<br/>init-<x>-secrets"]
P1 -- "/init-config" --> C1["configure init container<br/>sh script from gitlab-base"]
C1 -- "copies once<br/>at Pod start" --> E1["emptyDir<br/><x>-secrets"]
E1 -- "read-only" --> M1["main container"]
end
subgraph after["After"]
direction LR
S2["Secrets and<br/>ConfigMaps"] --> P2["projected volume<br/><x>-secrets"]
P2 -- "read-only" --> M2["main container"]
endThe main container mounts toolbox-secrets at /etc/gitlab in both cases, so it reads the same files.
Changes
- Database backup credentials: the registry and OpenBao credentials are projected into
toolbox-secretsunderregistry-db/andopenbao-db/. Before, separate volumes were mounted over these directories, which the script pre-created. The paths in/etc/gitlabdon't change. .s3cfg: with thes3backup backend,.s3cfgis projected at the root oftoolbox-secrets, where the script moved it.fsGroupwarning: Toolbox is added to the PostgreSQL SSLfsGroupwarning from !5562 (merged). A separate commit names the charts in the warning relative to the global chart, likegitlab.webservice, as GitLab Duo asked on !5562 (merged). That fix missed the merge of !5562 (merged).- Values and docs: the unused
init.imagevalue and doc rows are removed. Toolbox is added to the 10.6.0 upgrade notes. - Upgrade notes: the restart bullet now reads "Restart the Pods after you change the Secrets." Toolbox starts new processes, such as
gitlab-rakeorbackup-utility, in a running container, and they read the updated secret files, while settings rendered at container start keep their values. The previous wording suggested that a changed Secret has no effect at all before a restart. - Specs: the Toolbox exceptions from !5562 (merged) are gone. Toolbox assertions use the projected item paths like the other Rails Pods, and the PostgreSQL SSL path spec from !5562 (merged) also checks
toolbox-secrets.
The configure script only copied files
On master, the Toolbox script runs the shared copy loop, the PostgreSQL SSL, NATS, and Topology Service TLS snippets from !5562 (merged), two mkdir calls, and one mv for .s3cfg.
I replayed master's rendered script against the source volumes and compared the result with this branch's projected volume. The value sets covered defaults, PostgreSQL and Geo SSL, the s3 backup backend with the backup CronJob, and NATS, Topology Service, and Redis TLS. Every staged file is projected at the same path in the Deployment and the backup CronJob. The only differences:
- The files are owned by
root:<fsGroup>instead of the container user (git:git). The mode stays0440, except for the PostgreSQL SSL files, which the script set to0600. The mount now also has the projected..datasymlink layout. - The
registry-db/andopenbao-db/files come fromtoolbox-secretsinstead of their own volumes, at the same paths.
Related issues
Related to #6745
Author checklist
For general guidance, please follow our Contributing guide.
Required
For anything in this list which will not be completed, please provide a reason in the MR discussion.
- Merge Request Title and Description are up to date, accurate, and descriptive.
- MR targeting the appropriate branch.
- MR has a green pipeline.
- Documentation created/updated.
- Tests added/updated.
- Have you validated that your change works end-to-end on a real cluster deployment?
- The same templates were deployed in kind as part of !5555 (closed), including a Toolbox backup to S3.
- Equivalent MR/issue for omnibus-gitlab opened. Not applicable.
- When ready for review, MR is marked as ready (not a draft) and assigned to a reviewer.
Reviewers checklist
- As soon as you begin reviewing, select Start a review on your first comment so the MR shows Reviewer started review.
- MR has a green pipeline on https://gitlab.com/gitlab-org/charts/gitlab.
- Consider downstream impact to the Operator, as per evaluating impact from changes to GitLab chart.