Chart: the documented Vault/OpenBao Agent injector example cannot work (no service-account token, no serviceAccount values) #994

Closed
opened 2026-10-24 16:13:28 +00:00 by Cordy · 4 comments
Owner

Found in the #985 research (research-985-5 §4).

vault-k8s looks for a container mount whose path contains serviceaccount, else a projected volume named by vault.hashicorp.com/agent-service-account-token-volume-name; otherwise it fails with failed to find service account volume mount (VERIFIED, agent-inject/agent/agent.go). The chart sets automountServiceAccountToken: false (deploy/chart/templates/deployment.yaml:39-40) and has no service-account values. So the snippet in deploy-kubernetes.md:337-353 fails at admission, and the Vault role would bind to the namespace's default service account anyway.

OpenBao: openbao-k8s v1.4.0 (latest tag) still uses vault.hashicorp.com/...; main switched to openbao.org/... (unreleased); OpenBao's docs page is a draft with a third prefix that matches neither. VERIFIED. "OpenBao's documents its own" points readers at a wrong page.

Options.

  • (a) Chart values serviceAccount.create/name plus a documented projected token volume via extraVolumes (serviceAccountToken: {path: token, audience: vault, expirationSeconds: 600}) and the volume-name annotation. The Cairn container does not mount it. Keeps the token out of Cairn.
  • (b) Document automountServiceAccountToken: true for this route (weakens the no-token stance).
  • (c) Drop the Agent example; recommend ESO or the CSI driver.

Recommendation (a). Decision asked in #985.

Live test. Vault or OpenBao injector in a dogfood namespace; pod is mutated, /vault/secrets/oidc exists, ls /var/run/secrets/kubernetes.io is empty in the Cairn container. Also check whether the Secrets Store CSI provider needs the pod token (UNVERIFIED).

Found in the #985 research (research-985-5 §4). vault-k8s looks for a container mount whose path contains `serviceaccount`, else a projected volume named by `vault.hashicorp.com/agent-service-account-token-volume-name`; otherwise it fails with `failed to find service account volume mount` (VERIFIED, `agent-inject/agent/agent.go`). The chart sets `automountServiceAccountToken: false` (`deploy/chart/templates/deployment.yaml:39-40`) and has no service-account values. So the snippet in `deploy-kubernetes.md:337-353` fails at admission, and the Vault role would bind to the namespace's `default` service account anyway. OpenBao: openbao-k8s v1.4.0 (latest tag) still uses `vault.hashicorp.com/...`; main switched to `openbao.org/...` (unreleased); OpenBao's docs page is a draft with a third prefix that matches neither. VERIFIED. "OpenBao's documents its own" points readers at a wrong page. **Options.** - (a) Chart values `serviceAccount.create/name` plus a documented projected token volume via `extraVolumes` (`serviceAccountToken: {path: token, audience: vault, expirationSeconds: 600}`) and the volume-name annotation. The Cairn container does not mount it. Keeps the token out of Cairn. - (b) Document `automountServiceAccountToken: true` for this route (weakens the no-token stance). - (c) Drop the Agent example; recommend ESO or the CSI driver. Recommendation (a). Decision asked in #985. **Live test.** Vault or OpenBao injector in a dogfood namespace; pod is mutated, `/vault/secrets/oidc` exists, `ls /var/run/secrets/kubernetes.io` is empty in the Cairn container. Also check whether the Secrets Store CSI provider needs the pod token (UNVERIFIED).
Author
Owner

Decision (Nikola, 2026-10-24): option (a), chart values serviceAccount.create/name plus a documented projected token volume for the injector only; the Cairn container mounts no token. Live test with the injector in a dogfood namespace. Lands with the #985 batch.

Decision (Nikola, 2026-10-24): option (a), chart values `serviceAccount.create/name` plus a documented projected token volume for the injector only; the Cairn container mounts no token. Live test with the injector in a dogfood namespace. Lands with the #985 batch.
Cordy referenced this issue from a commit 2026-10-25 19:36:52 +00:00
Author
Owner

Chart part shipped in v0.6.354 (chart 0.6.0):

  • serviceAccount.create/name/annotations;
  • serviceAccountName set only when a name is given; the Cairn pod keeps automountServiceAccountToken: false;
  • the projected-token route documented in values.yaml and deploy-kubernetes.md;
  • restricted Pod Security Standard tests extended.

The CHANGELOG says "documented, not yet tested against a live injector". Keeping this open for the decided live test: install the Vault or OpenBao injector in a dogfood namespace and confirm all three:

  • the pod is mutated;
  • /vault/secrets/oidc exists;
  • the Cairn container has no /var/run/secrets/kubernetes.io.
Chart part shipped in v0.6.354 (chart 0.6.0): - `serviceAccount.create/name/annotations`; - `serviceAccountName` set only when a name is given; the Cairn pod keeps `automountServiceAccountToken: false`; - the projected-token route documented in values.yaml and deploy-kubernetes.md; - restricted Pod Security Standard tests extended. The CHANGELOG says "documented, not yet tested against a live injector". **Keeping this open** for the decided live test: install the Vault or OpenBao injector in a dogfood namespace and confirm all three: - the pod is mutated; - `/vault/secrets/oidc` exists; - the Cairn container has no `/var/run/secrets/kubernetes.io`.
Author
Owner

The injector live test is tracked in #1005, section D.

The injector live test is tracked in #1005, section D.
Author
Owner

Closing: the chart part shipped in v0.6.354 as decided (option a, serviceAccount values, deploy/chart/values.yaml:86). The injector live test stays tracked in #1005 section D.

Closing: the chart part shipped in v0.6.354 as decided (option a, `serviceAccount` values, `deploy/chart/values.yaml:86`). The injector live test stays tracked in #1005 section D.
Cordy closed this issue 2026-10-26 23:43:08 +00:00
Sign in to join this conversation.
No labels
No project
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: Cordy/Cairn#994
No description provided.