Drop the configure init container from the Rails Pods
What does this MR do?
Second step of the plan in #6745: remove the configure init container from Webservice, Sidekiq, Migrations and Geo Log Cursor. It uses the same approach as !5560 (merged), which is merged.
Goal
- Drop the
configurecontainer that neededgitlab-base. Theconfigureinit containers run a shell script from thegitlab-baseimage. Without them, these 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 volumes directly. The components still read the files only at startup, so Secret changes still need a Pod restart.
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 <x>-secrets at the same path in both cases, so it reads the same files.
Changes
- PostgreSQL SSL: new
gitlab.psql.ssl.secretSourceandgitlab.geo.psql.ssl.secretSourcehelpers project the SSL files topostgres/ssl/, where the script copied them. The client key isroot:<fsGroup>0440, which libpq accepts. fsGroupwarning: the release notes warn when PostgreSQL SSL is configured and one of these charts has nosecurityContext.fsGroup. The requirement isn't new: without anfsGroup, theconfigurecontainer already failed to read the root-owned key. Now the main container fails instead.- Workhorse: gets its own
workhorse-secretsprojected volume with its Redis secrets, replacingworkhorse.redis.secret-setup. - Values and docs: the unused
init.imagevalues and doc rows are removed.init.resourcesandinit.containerSecurityContextstay for the remaining init containers. These charts are added to the 10.6.0 upgrade notes from !5560 (merged). - Specs: assert on the projected item paths instead of the
configurescripts. Toolbox keeps itsconfigurecontainer until the next step.
The configure scripts only copied files
On master, the Webservice, Workhorse, Sidekiq, Migrations and Geo Log Cursor scripts only run mkdir -p, cp -L, and chmod on the PostgreSQL SSL files.
I replayed master's rendered scripts against the source volumes and compared the result with this branch's projected volumes. The value sets covered defaults, PostgreSQL and Geo SSL, metrics and Workhorse TLS, NATS and Topology Service TLS, Redis and Sentinel TLS, and a dedicated Workhorse Redis instance. Every staged file is projected at the same path. 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. - With a dedicated Workhorse Redis instance,
workhorse-secretsalso holds the global Sentinel TLS files, which Workhorse doesn't read.
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 PostgreSQL client-certificate authentication.
- 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.