Inject Vault secrets into Kubernetes pods using the Vault Agent sidecar injector

domain: developer.hashicorp.com/vault/docs/platform/k8s/injector · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Install Vault Agent Injector via the HashiCorp Vault Helm chart with `injector.enabled=true`; configure it to point to your Vault address
  2. Enable Kubernetes authentication in Vault and create a role binding your pod's ServiceAccount and namespace to a Vault policy
  3. Annotate your pod template with `vault.hashicorp.com/agent-inject: 'true'`, `vault.hashicorp.com/role: YOUR_ROLE`, and one `vault.hashicorp.com/agent-inject-secret-<filename>` annotation per secret path
  4. Optionally use a template annotation to control the rendered file format (e.g., export KEY=value shell syntax or JSON) inside the injected secret file
  5. Deploy the workload — the mutating webhook injects an init container that logs in to Vault, fetches secrets, and writes them to a shared in-memory volume before the app container starts
  6. For long-running pods, the sidecar agent container continues running to renew leases and refresh rotating secrets without restarting the app

Known gotchas

Related routes

Implement a mutating admission webhook to inject a sidecar container into pods
kubernetes.io · 6 steps · unrated
Sync Kubernetes secrets from HashiCorp Vault using External Secrets Operator
external-secrets.io/docs · 6 steps · unrated
Use Kustomize components to inject a shared sidecar and ConfigMap across multiple overlays without duplicating patch files
kubectl.docs.kubernetes.io · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans