05 — Helm & Configuration

Focus: Helm. How BitVault is packaged and configured: a shared library chart, thin per-service charts, per-environment values, and the templating-vs-rendered debate. Helm is also the self-host install artifact (ADR-0012).


1. Chart architecture: library chart + thin service charts

flowchart TB
    classDef l fill:#fde68a,stroke:#b45309,color:#111827;
    classDef s fill:#bbf7d0,stroke:#15803d,color:#111827;
    classDef v fill:#fbcfe8,stroke:#be185d,color:#111827;
    lib["bitvault-common (library chart)<br/>templates: Rollout/Deployment · Service · HPA ·<br/>NetworkPolicy · PDB · ServiceMonitor · ExternalSecret"]:::l
    gw["chart: gateway"]:::s
    api["chart: bitvaultd"]:::s
    wk["chart: worker"]:::s
    web["chart: web"]:::s
    lib --> gw & api & wk & web
    base["values.yaml (defaults)"]:::v --> gw & api & wk & web
    over["values-{dev,staging,prod}.yaml (GitOps repo)"]:::v --> gw & api & wk & web

2. Values: defaults + per-environment overlays


3. Templating at sync vs rendered manifests (a real choice)

Approach How Pro Con
Helm rendered by ArgoCD at sync ArgoCD runs helm template on sync simple, dynamic, less to store the Git diff is values, not the resulting manifests (surprises possible)
Rendered-manifests pattern CI runs helm template → commits plain YAML to GitOps repo; ArgoCD applies YAML the diff shows exactly what will change; no templating at deploy; auditable extra CI step + more YAML in Git

Decision: start with ArgoCD-renders-Helm (simplest, fewest moving parts); offer rendered-manifests for prod where reviewers want to see the literal manifest diff before approving (08). Both keep the chart as the single templating source.


4. Helm vs Kustomize


5. Chart quality gates (in CI, 07)

helm lintschema validation (values.schema.json, kubeconform) → unit tests (helm-unittest) → policy (conftest/OPA: e.g. “must set resource limits”, “no :latest”, “must run non-root”) → render + diff in PRs. Charts are versioned (chart version ≠ appVersion) and published to an OCI registry for self-host.


6. Tradeoffs / Alternatives / Scaling

Tradeoffs. A library chart adds indirection but eliminates copy-paste drift across services — the right trade once there are >2 services. ArgoCD-renders-Helm trades diff auditability for simplicity (mitigated by the rendered-manifests option for prod).

Alternatives considered.

Scaling concerns.

References