Skip to content

[SHOT-216] feat: Add generic extra volumes to self-host hook/job and mssql pods - #570

Open
keithhubner wants to merge 2 commits into
mainfrom
SHOT-216-rootless-jobs
Open

[SHOT-216] feat: Add generic extra volumes to self-host hook/job and mssql pods#570
keithhubner wants to merge 2 commits into
mainfrom
SHOT-216-rootless-jobs

Conversation

@keithhubner

@keithhubner keithhubner commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

🎟️ Tracking

Jira: SHOT-216

Users running the self-host chart with a hardened rootless profile (readOnlyRootFilesystem: true) hit a problem: with a read-only root filesystem, the hook/job and database containers have nowhere to write scratch space (mainly /tmp), so several pods fail. Previously the only workaround was maintaining a local chart patch and re-applying it on every release. This PR upstreams a generic fix.

📔 Objective

Add configurable extraVolumeMounts / extraVolumes to the hook/job and database pods, which previously had no extra-volume support:

  • jobs.extraVolumeMounts / jobs.extraVolumes — shared across the five pre/post-install hook & job pods: pre-install-job, pre-install-secret-sql, pre-install-db-migrator-job, post-install-db-migrator-job, post-delete-hook (including the generate-identity-cert and wait-for-db init containers).
  • database.extraVolumeMounts / database.extraVolumes — the MSSQL StatefulSet.

This mirrors the existing per-component pattern (e.g. component.api.extraVolumeMounts), so rootless deployments can supply their writable scratch (e.g. a /tmp emptyDir) through values instead of maintaining a chart patch. All keys default to [], so the change is a no-op for existing users (verified: default render is identical to main).

The app-service templates already supported extra volumes upstream and were left unchanged. Example usage is documented in the chart README under Optional Values → Extra Volumes.

Note on writable MSSQL secrets

A common companion need for the rootless MSSQL pod is a writable mssql-secrets volume at /var/opt/mssql/secrets. Under this generic approach that is not hardcoded — it is supplied via database.extraVolumes / database.extraVolumeMounts (see the README example).

✅ Verification

  • helm unittest charts/self-host — 149/149 pass (new tests/hook_extras_test.yaml suite covers render + empty-is-no-op for all six templates, including both init containers).
  • values.schema.json regenerated with helm-schema 0.23.4 (matches CI schema check).
  • ct lint --charts charts/self-host passes.
  • Default render diff vs main is empty (aside from randomly-generated secrets).
  • Render with sample jobs/database extra values confirms the volume + mount appear in all five Jobs and the MSSQL StatefulSet, producing valid YAML.

@keithhubner keithhubner added ai-review Request a Claude code review version:minor New functionality added in a backwards-compatible manner. labels Jul 22, 2026
@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed the addition of jobs.extraVolumeMounts/extraVolumes (shared across pre-install-job, pre-install-secret-sql, pre-install-db-migrator-job, post-install-db-migrator-job, and post-delete-hook, including the generate-identity-cert and wait-for-db init containers) and database.extraVolumeMounts/extraVolumes on the MSSQL StatefulSet. Verified each injection point's indent value against its sibling list items (8 for the job pods/containers, 10 for the post-install init container, 12 for the MSSQL container), confirmed empty-list no-op behavior via {{- with }}, and the conditional volumeMounts:/volumes: key emission in post-delete-hook.yaml where no default mounts exist. Schema entries mirror the established per-component pattern, all keys default to [] for backwards compatibility, and the new tests/hook_extras_test.yaml suite covers render plus empty-is-no-op across all six templates.

No security, correctness, or breaking-change concerns found. Chart.yaml was correctly left unbumped with the version:minor label applied per the label-driven CD process.

…mssql pods

Render configurable extraVolumeMounts/extraVolumes on the pre/post-install
hook and job pods (jobs.*) and the MSSQL StatefulSet (database.*), mirroring
the existing per-component pattern. This lets rootless deployments
(readOnlyRootFilesystem: true) supply writable scratch (e.g. /tmp) via values
instead of maintaining a chart patch.

Regenerates values.schema.json, documents the new keys in the chart README,
and adds helm-unittest coverage in tests/hook_extras_test.yaml.
@keithhubner
keithhubner force-pushed the SHOT-216-rootless-jobs branch from bc6bbb6 to 441afb3 Compare July 22, 2026 13:03
@keithhubner
keithhubner marked this pull request as ready for review July 23, 2026 11:03
@keithhubner
keithhubner requested a review from a team as a code owner July 23, 2026 11:03
@keithhubner
keithhubner requested a review from mimartin12 July 23, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review version:minor New functionality added in a backwards-compatible manner.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant