Drop the configure init container from Mailroom, Exporter and Pages

What does this MR do?

First step of the plan in #6745: remove the configure init container from Mailroom, GitLab Exporter and GitLab Pages.

Goal

  • Drop the configure container that needed gitlab-base. The configure init containers run a shell script from the gitlab-base image. Without them, these Pods no longer need the gitlab-base image.
  • No copy at Pod start. The init container copied the Secrets into an emptyDir once, 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-&lt;x&gt;-secrets"]
    P1 -- "/init-config" --> C1["configure init container<br/>sh script from gitlab-base"]
    C1 -- "copies once<br/>at Pod start" --> E1["emptyDir<br/>&lt;x&gt;-secrets"]
    E1 -- "read-only" --> M1["main container"]
  end
  subgraph after["After"]
    direction LR
    S2["Secrets and<br/>ConfigMaps"] --> P2["projected volume<br/>&lt;x&gt;-secrets"]
    P2 -- "read-only" --> M2["main container"]
  end

The main container mounts <x>-secrets at the same path in both cases, so it reads the same files.

The configure script only copies files

All three scripts are rendered from the shared helper gitlab.scripts.configure.secrets. For each directory name, it runs mkdir -p and cp -f -v -r -L /init-config/<name>/. /init-secrets/<name>/. It skips optional names whose directory doesn't exist. It doesn't template, rename, generate, or change any file.

Rendered Mailroom script on master
# BEGIN gitlab.scripts.configure.secrets
set -e
config_dir="/init-config"
secret_dir="/init-secrets"
# required
for secret in mailroom ; do
  mkdir -p "${secret_dir}/${secret}"
  cp -f -v -r -L "${config_dir}/${secret}/." "${secret_dir}/${secret}/"
done
# optional
for secret in redis redis-sentinel ; do
  if [ -e "${config_dir}/${secret}" ]; then
    mkdir -p "${secret_dir}/${secret}"
    cp -f -v -r -L "${config_dir}/${secret}/." "${secret_dir}/${secret}/"
  fi
done
# END gitlab.scripts.configure.secrets
Rendered Pages script on master (metrics TLS enabled)
# BEGIN gitlab.scripts.configure.secrets
set -e
config_dir="/init-config"
secret_dir="/init-secrets"
# required
for secret in pages ; do
  mkdir -p "${secret_dir}/${secret}"
  cp -f -v -r -L "${config_dir}/${secret}/." "${secret_dir}/${secret}/"
done
# END gitlab.scripts.configure.secrets
  mkdir -p /init-secrets/pages-metrics
  cp -v -L /init-config/pages-metrics/pages-metrics.crt /init-secrets/pages-metrics/pages-metrics.crt
  cp -v -L /init-config/pages-metrics/pages-metrics.key /init-secrets/pages-metrics/pages-metrics.key

A comparison of helm template output from master (732344da) with this branch confirmed this for all three Deployments, with default values and with unconsolidated object storage:

  • The new <x>-secrets projected volume equals master's init-<x>-secrets volume except for its name, and for Pages, the removed objectstorage/pages item (see below).
  • The main container's volumeMounts are unchanged.
  • Running master's rendered scripts against the source volume staged the same files that the projected volume now provides: Mailroom 6 files, Exporter 3, and Pages 3 with metrics TLS.

The files differ only in their owner: the emptyDir copies were owned by the container user (git:git), the projected files are owned by root:<fsGroup>. The mode is 0440 in both cases. The mount now also has the projected ..data symlink layout.

@WarheadsSE also deployed base and head side by side in k3d: the main containers see the same files with the same content.

Changes

Each chart mounts the projected volume directly, under the former emptyDir name.

  • GitLab Exporter also drops the PostgreSQL SSL volume. Only the configure container mounted it, and its script never read it.
  • GitLab Pages no longer gets the Pages object storage connection. Master projected it into init-pages-secrets, but the script never copied it, and Pages doesn't read it. Only Rails does, from its own mount. A spec checks that pages-secrets has no objectstorage/ item.
  • The init.image values and their documentation rows are removed, as nothing uses them anymore. init.resources and init.containerSecurityContext stay, because the certificates init container uses them.
  • The 10.6.0 upgrade notes describe the visible changes: these charts no longer have an init.image setting, the Pods still need an fsGroup, and Secret changes still need a Pod restart.

The shared shell helpers are removed in the final cleanup MR of the plan.

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). The Exporter ran there, and the files mounted in each container matched what the configure scripts staged.
  • 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

🤖 Generated with Claude Code

Edited by Clemens Beck

Merge request reports

Loading
Loading