Skip to main content
🎓 Claude Code Masterclass Learn AI-assisted development on Udemy — plus the companion book on Leanpub & Amazon. Start Learning
Secrets management Vault ESO
DevOps

Secrets Management: HashiCorp Vault vs External Secrets...

Where should your Kubernetes secrets live? Comparing Vault, External Secrets Operator, and cloud-native options for production secrets management.

LB
Luca Berton
· 1 min read

Kubernetes Secrets Are Not Secret

kubectl get secret my-secret -o jsonpath='{.data.password}' | base64 -d

That’s it. Base64 is encoding, not encryption. Anyone with RBAC read access to the namespace can see every secret. In most clusters, that’s way too many people.

You need a secrets management solution. Here are the real options.

Option 1: HashiCorp Vault

The gold standard. Full-featured, battle-tested, complex.

# Install Vault on Kubernetes
helm install vault hashicorp/vault \
  --set server.ha.enabled=true \
  --set server.ha.raft.enabled=true \
  --namespace vault

Vault Agent Sidecar (automatic injection)

apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app
spec:
  template:
    metadata:
      annotations:
        vault.hashicorp.com/agent-inject: "true"
        vault.hashicorp.com/role: "my-app"
        vault.hashicorp.com/agent-inject-secret-db: "secret/data/db/credentials"
    spec:
      containers:
        - name: my-app
          # Secret available at /vault/secrets/db

When to Choose Vault

  • Multi-cloud or hybrid environments
  • Dynamic secrets (database credentials that rotate automatically)
  • PKI / certificate management
  • Strict compliance requirements (FIPS, SOC2)
  • Large organizations with dedicated platform teams

The Complexity Tax

Vault is operationally expensive. HA setup, unsealing, token management, policy administration. I’ve seen teams spend 20% of their platform engineering time managing Vault itself.

Option 2: External Secrets Operator (ESO)

ESO syncs secrets FROM your cloud provider’s secret store INTO Kubernetes secrets:

apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
  name: db-credentials
spec:
  refreshInterval: 1h
  secretStoreRef:
    name: aws-secrets-manager
    kind: ClusterSecretStore
  target:
    name: db-credentials
  data:
    - secretKey: username
      remoteRef:
        key: production/db/credentials
        property: username
    - secretKey: password
      remoteRef:
        key: production/db/credentials
        property: password

SecretStore Configuration

apiVersion: external-secrets.io/v1beta1
kind: ClusterSecretStore
metadata:
  name: aws-secrets-manager
spec:
  provider:
    aws:
      service: SecretsManager
      region: eu-west-1
      auth:
        jwt:
          serviceAccountRef:
            name: external-secrets
            namespace: external-secrets

When to Choose ESO

  • Already using a cloud provider’s secret store
  • Want GitOps-friendly secrets management
  • Simpler operational overhead than Vault
  • Multi-cluster with centralized secrets

Comparison

                    Vault           ESO              Sealed Secrets
Complexity          High            Medium           Low
Dynamic secrets     Yes             No (sync only)   No
Rotation            Automatic       Manual + sync    Manual
Cloud-agnostic      Yes             Via providers    Yes
GitOps friendly     Limited         Yes              Yes
Operational cost    High            Low              Minimal
Best for            Enterprise      Cloud-native     Small teams

My Recommendation

For most Kubernetes deployments:

Small team (1-20 devs):
  → Cloud provider secret store + ESO
  → Simple, managed, affordable

Medium team (20-100 devs):
  → ESO + cloud secret store for most secrets
  → Vault for dynamic secrets (DB creds) if needed

Large enterprise (100+ devs):
  → Vault for centralized secrets management
  → ESO as the Kubernetes integration layer
  → Cloud KMS for encryption keys

Automating Secrets Infrastructure

I deploy the secrets management stack with Ansible:

- name: Deploy secrets management
  hosts: k8s_clusters
  tasks:
    - name: Install External Secrets Operator
      helm:
        name: external-secrets
        chart_ref: external-secrets/external-secrets
        release_namespace: external-secrets
        create_namespace: true

    - name: Configure ClusterSecretStore
      kubernetes.core.k8s:
        state: present
        template: cluster-secret-store.yml.j2

The infrastructure provisioning (IAM roles, KMS keys, secret store setup) I handle with Terraform — patterns at Terraform Pilot. The Kubernetes-side automation with Ansible at Ansible Pilot.

Whatever you choose — stop using plain Kubernetes secrets in production. The base64 “encryption” is a false sense of security that will bite you.

#secrets-management #vault #kubernetes #external-secrets #security #devops
Share:
Cloud Infrastructure Design

Need help with Cloud Infrastructure Design?

Build resilient, cost-effective cloud environments with expert architecture consulting.

Learn more about Cloud Infrastructure Design

Want to operate this yourself, in production?

Take the free AI Platform Engineer Readiness Scorecard to see which skills transfer — then build a production-shaped AI platform in the 4-week Bootcamp.

Take the Scorecard →
Luca Berton — AI & Cloud Advisor, Docker Captain

Luca Berton

AI & Cloud Advisor · Docker Captain · KubeCon Speaker

15+ years in enterprise infrastructure. Author of 8 technical books, creator of Ansible Pilot (1M+ YouTube views, 648K site users). Former Red Hat engineer. Speaker at KubeCon EU 2026 and Red Hat Summit 2026.

Free 30-min AI & Cloud consultation

Book Now