Deploy the Vault Secrets Operator across clusters #1524

Closed
opened 2026-08-12 14:51:40 +00:00 by ginjiruu · 2 comments
Owner

Deploy the Vault Secrets Operator across clusters

ADR-0004 in lab/iac designates the Vault Secrets Operator (VSO) as the read path for Vault secrets — per-app VaultAuth (serviceAccountRef to the app's own SA) syncing scoped KV paths into native Kubernetes Secrets via VaultStaticSecret. VSO is currently documented but deployed nowhere. This change ships the operator itself.

Why VSO for reads (and why not just ESO)

The ADR's original framing — that ESO's ClusterSecretStore gives every app "kingdom-wide visibility" — describes the current setup, not a fundamental ESO limitation. ESO can do per-app identity: a namespaced SecretStore with auth.kubernetes.serviceAccountRef → the app's own SA → a per-app Vault role → a per-app policy is structurally the same mapping as VSO's VaultAuth.serviceAccountRef. A reconfigured per-app ESO would already provide per-app Vault isolation plus the same K8s-side RBAC layer on the output Secret.

VSO's genuine deltas over a well-configured per-app ESO are narrower than "ESO can't do per-app":

  • Structural same-namespace binding. VSO requires VaultAuth, its ServiceAccount, and the VaultStaticSecret to co-locate in one namespace — a hard guardrail against cross-namespace impersonation. ESO's equivalent is convention + config (a ClusterSecretStore with cross-namespace reach is a footgun you have to close with conditions/namespaceSelector).
  • First-class Vault-native dynamic/PKI CRs. VaultDynamicSecret and VaultPKISecret are scoped per-app SA the same way as static secrets, so the model extends to dynamic and PKI secrets without a second integration. ESO handles dynamic secrets via a generator (a different mechanism) and PKI is more awkward.
  • First-party support. VSO is a fully-supported HashiCorp Vault component; ESO is a third-party Linux Foundation project.

The one capability with no overlap is the write path: ESO PushSecret has no VSO equivalent (VSO has no push primitive). That is the unambiguous reason ESO stays in the stack. VSO's win on the read path is ergonomics + the structural guarantee, not a capability ESO fundamentally lacks.

Scope

Deploy VSO on the clusters that already consume Vault via the ESO vault-backend ClusterSecretStore:

  • mini
  • portable (runs the Vault server itself)
  • remote

mx2 and localhost are out of scope.

Deliverables

  1. generic-templates/vault-secrets-operator/ — a shared template mirroring generic-templates/cnpg/ + the tofu-controller crds: Create idiom:
    • HelmRepository hashicorp → https://helm.releases.hashicorp.com
    • HelmRelease vault-secrets-operator v1.5.1 (chart self-manages CRDs via install.crds: Create / upgrade.crds: CreateReplace)
    • defaultVaultConnection.enabled: true → https://vault.animeteamspeak.moe (public letsencrypt cert, no skipTLSVerify/caCertSecret)
    • defaultAuthMethod.enabled: false — ADR-0004 mandates per-app VaultAuth, no shared operator identity
  2. Per-cluster wiring — top-level Kustomization pointer clusters/<name>/vault-secrets-operator.yaml for mini, portable, remote.
  3. HelmRepository de-duplication — drop the now-duplicate hashicorp HelmRepository from clusters/portable/helmsources/ and clusters/remote/helmsources/ (the template ships the identical source; clusters/portable/vault/helmRelease.yaml is unaffected — same name/url).

Out of scope (separate lab/iac work, per ADR-0004)

  • Mounting the Vault kubernetes auth backend + token-reviewer
  • Per-app vault_kubernetes_auth_backend_role bound to app-a-vso
  • app-a-vso ServiceAccounts and per-app VaultAuth/VaultStaticSecret/VaultAuthGlobal CRs in app repos

The operator reconciles fine without these; only actual VaultStaticSecret CRs trigger Vault logins. ESO ClusterSecretStore vault-backend stays (write path + existing apps).

## Deploy the Vault Secrets Operator across clusters ADR-0004 in `lab/iac` designates the Vault Secrets Operator (VSO) as the read path for Vault secrets — per-app `VaultAuth` (`serviceAccountRef` to the app's own SA) syncing scoped KV paths into native Kubernetes Secrets via `VaultStaticSecret`. VSO is currently documented but **deployed nowhere**. This change ships the operator itself. ## Why VSO for reads (and why not just ESO) The ADR's original framing — that ESO's `ClusterSecretStore` gives every app "kingdom-wide visibility" — describes the **current** setup, not a fundamental ESO limitation. ESO *can* do per-app identity: a **namespaced `SecretStore`** with `auth.kubernetes.serviceAccountRef` → the app's own SA → a per-app Vault role → a per-app policy is structurally the same mapping as VSO's `VaultAuth.serviceAccountRef`. A reconfigured per-app ESO would already provide per-app Vault isolation plus the same K8s-side RBAC layer on the output `Secret`. VSO's genuine deltas over a well-configured per-app ESO are narrower than "ESO can't do per-app": - **Structural same-namespace binding.** VSO *requires* `VaultAuth`, its ServiceAccount, and the `VaultStaticSecret` to co-locate in one namespace — a hard guardrail against cross-namespace impersonation. ESO's equivalent is convention + config (a `ClusterSecretStore` with cross-namespace reach is a footgun you have to close with `conditions`/`namespaceSelector`). - **First-class Vault-native dynamic/PKI CRs.** `VaultDynamicSecret` and `VaultPKISecret` are scoped per-app SA the same way as static secrets, so the model extends to dynamic and PKI secrets without a second integration. ESO handles dynamic secrets via a *generator* (a different mechanism) and PKI is more awkward. - **First-party support.** VSO is a fully-supported HashiCorp Vault component; ESO is a third-party Linux Foundation project. The one capability with **no overlap** is the write path: ESO `PushSecret` has no VSO equivalent (VSO has no push primitive). That is the unambiguous reason ESO stays in the stack. VSO's win on the read path is ergonomics + the structural guarantee, not a capability ESO fundamentally lacks. ## Scope Deploy VSO on the clusters that already consume Vault via the ESO `vault-backend` ClusterSecretStore: - `mini` - `portable` (runs the Vault server itself) - `remote` `mx2` and `localhost` are out of scope. ## Deliverables 1. **`generic-templates/vault-secrets-operator/`** — a shared template mirroring `generic-templates/cnpg/` + the tofu-controller `crds: Create` idiom: - `HelmRepository hashicorp` → `https://helm.releases.hashicorp.com` - `HelmRelease vault-secrets-operator` v1.5.1 (chart self-manages CRDs via `install.crds: Create` / `upgrade.crds: CreateReplace`) - `defaultVaultConnection.enabled: true` → `https://vault.animeteamspeak.moe` (public letsencrypt cert, no `skipTLSVerify`/`caCertSecret`) - `defaultAuthMethod.enabled: false` — ADR-0004 mandates per-app `VaultAuth`, no shared operator identity 2. **Per-cluster wiring** — top-level `Kustomization` pointer `clusters/<name>/vault-secrets-operator.yaml` for mini, portable, remote. 3. **HelmRepository de-duplication** — drop the now-duplicate `hashicorp` HelmRepository from `clusters/portable/helmsources/` and `clusters/remote/helmsources/` (the template ships the identical source; `clusters/portable/vault/helmRelease.yaml` is unaffected — same name/url). ## Out of scope (separate `lab/iac` work, per ADR-0004) - Mounting the Vault `kubernetes` auth backend + token-reviewer - Per-app `vault_kubernetes_auth_backend_role` bound to `app-a-vso` - `app-a-vso` ServiceAccounts and per-app `VaultAuth`/`VaultStaticSecret`/`VaultAuthGlobal` CRs in app repos The operator reconciles fine without these; only actual `VaultStaticSecret` CRs trigger Vault logins. ESO `ClusterSecretStore vault-backend` stays (write path + existing apps).
Author
Owner

Closing: reads go through ESO with ServiceAccount/JWT auth to OpenBao (#1669, lab/iac eso-mini.tf). VSO PR #1525 was closed unmerged.

Closing: reads go through ESO with ServiceAccount/JWT auth to OpenBao (#1669, lab/iac eso-mini.tf). VSO PR #1525 was closed unmerged.
Author
Owner

Follow-up to the closing note: closing this does not mean the per-app isolation argued for above was delivered. ESO reads are isolated per cluster today. ADR-0012 (lab/iac#188) records that; per-app SecretStores are lab/iac#186 and the interim namespace lists are #1784.

Follow-up to the closing note: closing this does not mean the per-app isolation argued for above was delivered. ESO reads are isolated per cluster today. ADR-0012 (lab/iac#188) records that; per-app SecretStores are lab/iac#186 and the interim namespace lists are #1784.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lab/clusters#1524
No description provided.