UNCLASSIFIED - NO CUI

Improve Vault post-startup tasks

Summary

Context ->

The post startup tasks were originally added as Big Bang’s autoInit flow for dev/CI/demo environments because Vault starts uninitialized and sealed. The custom Job/ConfigMap/PVC initialized and unsealed Vault, wrote the root token and init output to the vault-token secret, enabled Kubernetes auth, and configured the Prometheus policy/role. Our docs already call out that autoInit should be disabled for operational deployments.

This MR moves the same tasks into the upstream-supported server.postStart hook. The new script checks Vault’s current state, initializes only when necessary, reuses the existing token secret on upgrades/restarts, handles unseal/auto-unseal, and reapplies the Kubernetes and monitoring configuration. It also removes the extra Job/PVC/base container and replaces broad cluster-scoped RBAC with namespace-scoped secret access.

The main behavioral change is that the logic now runs whenever a Vault pod starts, so it was made state-aware/idempotent.

  • Move Vault auto-initialize, unseal, token secret, Kubernetes auth, and monitoring auth setup into the upstream server.postStart lifecycle hook.
  • Make repeated pod startup state-aware and remove the package-maintained init Job, PVC, and ConfigMap resources.
  • Streamline the documented SSO OIDC accessor lookup without requiring jq in the Vault container.
  • Add focused Bats coverage for postStart rendering, RBAC, disabled auto-init, TLS addressing, and pretty-printed Kubernetes Secret responses.

Validation

  • bats chart/test/unit/bigbang-vault-post-start.bats
  • helm lint chart/
  • helm unittest chart/
  • helm template vault chart/
  • helm template vault chart/ --set networkPolicies.enabled=true --set istio.enabled=true --set istio.authorizationPolicies.enabled=true
  • helm template vault chart/ --set tls.cert=test-cert --set tls.key=test-key --set upstream.global.tlsDisable=false
  • git diff --check
  • Live Big Bang k3d/Flux clean install and umbrella upgrade at 43ebe39ed34180f65f47035854f9a3a8b8eb1a6c
  • Live pod restart validation preserving the existing token Secret, unsealing Vault, and reapplying Kubernetes/monitoring auth
  • Playwright authenticated UI validation through https://vault.bigbang.dev/ui/

Supporting Evidence

01-vault-flux

02-vault-functional

03-vault-ui

Linked issues

#192 (closed)

Upgrade Notices

N/A

Edited by Christopher O'Connell

Merge request reports

Loading
Loading