Skip to content

Sealed Secrets vs SOPS vs External Secrets: which one to use

A decision guide for Kubernetes secrets in Git — what Sealed Secrets, SOPS and External Secrets Operator each do to the secret material, and how they differ on rotation, disaster recovery, audit and bootstrapping.

The three patterns differ in one thing: where the plaintext ends up and who can get it back. Sealed Secrets encrypts the value into the repository, and only the controller running in that cluster holds the private key that reverses it. SOPS also encrypts the value into the repository, but against a key you manage — an age key or a cloud KMS key — that your CD tool holds at deploy time. External Secrets Operator puts nothing sensitive in the repository at all: it commits a pointer to an entry in an external secret manager and materializes the Secret at runtime. So: if you already run Vault or a cloud secret manager, use External Secrets. If the repository must be self-contained and you would rather not distribute a key to anyone, use Sealed Secrets. If you want encrypted values that still review cleanly in a pull request and you trust your CD tool with a key, use SOPS.

What you’ll accomplish

  • A written, defensible choice of one pattern, with the reason recorded next to it.
  • A clear view of what each pattern costs during a rotation and during a rebuild into a fresh cluster — the two moments where the choice bites.
  • A pilot on a single namespace, so the migration is reversible before it is wide.
  • Key material backed up and restore-tested, which is what turns Sealed Secrets from a liability into a workable pattern.
  • End state: one pattern in production, the plaintext accounted for wherever it exists, and a runbook the on-call person can follow at 3 a.m.

Prerequisites

  • A cluster you can install a controller into, with cluster-admin for the install. Any supported release works; none of the three needs a recent API.
  • A GitOps controller or pipeline that already applies manifests — Flux, Argo CD, or a kubectl apply step in CI. Without one the comparison changes shape, because the CD tool is what holds a key in the SOPS case.
  • kubectl against the target cluster, plus kubeseal and sops locally to pilot those two.
  • For External Secrets: an existing secret manager and a way for the cluster to authenticate to it — IRSA on EKS, Workload Identity on GKE, Kubernetes auth on Vault. Without that you are choosing to build the secret manager too, which is a bigger project than this decision.
  • An honest inventory. You cannot pick well without knowing whether you have twelve secrets or four hundred, and whether any are shared across clusters.

How it works

All three end at the same place — an ordinary Kubernetes Secret in etcd, base64-encoded, readable by anyone with get secrets RBAC in that namespace. None of them changes that. What they change is the path the value takes to get there, and who can reverse the encryption along the way.

Three GitOps secret data flows compared: developer on the left, Git repository in the middle, cluster on the right, with Sealed Secrets sealing to the controller certificate, SOPS encrypting against a key the CD tool holds, and External Secrets keeping the plaintext in an external manager Git never touches

Sealed Secrets

The controller generates an RSA key pair on first start and stores it as a Secret in its own namespace. kubeseal fetches the public certificate from the controller and encrypts each value. The result is a SealedSecret in the bitnami.com/v1alpha1 API group, whose spec.encryptedData holds one ciphertext blob per key. That is what you commit.

Scope is where people trip. By default kubeseal seals in strict scope, binding the ciphertext to both the namespace and the name of the target Secret. Rename the Secret or move it and the controller refuses — not because of a check that could be talked out of, but because the namespace and name are woven into the encryption itself. kubeseal --scope namespace-wide relaxes that to any name in the namespace, --scope cluster-wide to any namespace. Each relaxation buys convenience by widening who can take your ciphertext and mount it somewhere they control.

The controller renews its sealing key on a schedule (30 days by default), keeping every previous private key so old objects still decrypt. That is renewal, not re-encryption: ciphertext already committed stays bound to whichever key sealed it until you run kubeseal --re-encrypt against it.

Which leads to the problem that dominates this pattern. Lose those private keys — cluster destroyed, namespace wiped, etcd unrecoverable — and every SealedSecret in your repository is permanently unreadable ciphertext. Not hard to recover: unreadable. Backing up the sealing keys is what makes Sealed Secrets a legitimate choice rather than a time bomb.

SOPS

SOPS encrypts values, not files. A SOPS-encrypted Secret is still a YAML document with readable apiVersion, kind, metadata and key names — only the values become ENC[AES256_GCM,data:...] strings, plus a sops block holding the encrypted data key and a MAC. A pull request adding a database password shows which key changed and in which file: exactly the review signal an opaque blob destroys.

A .sops.yaml at the repository root holds creation_rules, matched by path_regex, deciding which key encrypts a new file and which fields get encrypted; for Kubernetes manifests you almost always want encrypted_regex set so only data and stringData are covered. Backends are age — one small key pair, no cloud account, the usual choice for small teams — and the cloud KMS services, where IAM governs access and every decrypt is logged.

Two integration routes. Either the pipeline decrypts: a CI step runs sops decrypt and pipes into kubectl apply, so the runner sees plaintext and your CI logs join the threat model. Or the cluster decrypts: Flux’s kustomize-controller reads spec.decryption.provider: sops on a Kustomization and pulls the age key from a Secret you reference, so plaintext never leaves the cluster. Argo CD has no native equivalent and is usually wired up with a plugin.

Either way the key management is yours: somebody generates the age key, gets it onto the cluster or the runner, keeps it out of the repository, and rotates it when a person with a copy leaves.

External Secrets Operator

Two kinds do the work. A SecretStore (namespaced) or ClusterSecretStore (cluster-scoped) describes the backend and how to authenticate to it. An ExternalSecret names a store, a refresh interval, a target Secret, and the remote keys to pull. The repository holds only those — a store address and a key path. No ciphertext to lose, no key to back up, nothing in a diff a leaked repository would help an attacker with.

Rotation is where it earns its keep. Change the value in the secret manager and, at the next refresh interval, ESO writes it into the Kubernetes Secret — no commit, no re-seal, and if six clusters reference the same remote key, all six converge on their own schedule. A rewritten Secret does not restart the Pods consuming it, though; a controller like Reloader, or a rollout, is still needed to get the value into a running process.

The cost is a new dependency: the cluster needs credentials and network reach to that store for secrets to exist at all. On a normal day this is invisible. During a cold rebuild it is the whole story — the repository alone will not produce a working cluster.

The comparison, on the axes that matter

Sealed SecretsSOPSExternal Secrets
In the repoCiphertextCiphertext, readable structureA pointer only
Who can decryptThe controller in that clusterWhoever holds the age or KMS keyWhoever the store authorizes
RotationRe-seal and commitRe-encrypt and commitChange it in the store; propagates
Cold rebuildFails unless sealing keys restoredWorks if the key is restoredNeeds the store reachable and authenticated
Multi-clusterRe-seal per clusterShare the key across clustersOne remote key, many clusters
PR diffOpaque blob changedField names visible, values opaqueFully readable, nothing sensitive
Audit of readsNone to speak ofKMS logs decrypts; age logs nothingThe store logs every read
Bootstrap needController and its keyKey present before first applyStore credentials first
New failure modeLost key equals lost secretsKey distribution and sprawlStore outage blocks secret creation

All three have a version of the bootstrapping problem: you need a secret to get the secrets. Sealed Secrets needs its controller running with its key restored; SOPS needs the age key on the cluster or the runner; ESO needs credentials for the store. Something is placed by hand, or by an identity mechanism that is not a secret at all — an instance profile, a workload identity binding — before GitOps can take over.

What each one looks like in the repo

A SealedSecret, ciphertext truncated:

apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
  name: api-creds
  namespace: apps
spec:
  encryptedData:
    apiKey: AgBvA7k2R9x...      # hundreds of base64 characters in reality
  template:
    metadata:
      name: api-creds
      namespace: apps
    type: Opaque

The same secret under SOPS, with only the value encrypted:

apiVersion: v1
kind: Secret
metadata:
  name: api-creds
  namespace: apps
stringData:
  apiKey: ENC[AES256_GCM,data:9pQ2Tg==,iv:...,tag:...,type:str]
sops:
  age:
    - recipient: age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p
      enc: |
        -----BEGIN AGE ENCRYPTED FILE-----
        ...
        -----END AGE ENCRYPTED FILE-----
  mac: ENC[AES256_GCM,data:...]

And as an ExternalSecret, which contains no secret material:

apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
  name: api-creds
  namespace: apps
spec:
  refreshInterval: 1h
  secretStoreRef:
    name: vault-backend
    kind: SecretStore
  target:
    name: api-creds
    creationPolicy: Owner
  data:
    - secretKey: apiKey
      remoteRef:
        key: prod/api-creds
        property: apiKey

Recent External Secrets releases serve the v1 API; older installs serve external-secrets.io/v1beta1 with the same field layout. Confirm with kubectl api-resources --api-group=external-secrets.io before copying a manifest from anywhere, this page included.

Step-by-step

This section is about making and landing the decision. The install walkthrough for each pattern lives in its own article: Sealed Secrets on kubeadm, SOPS with age and Flux, and External Secrets Operator on k3s.

  1. Inventory what you actually have. Count the Secrets, and note which are shared across clusters and which rotate on a schedule.

    kubectl get secrets -A \
      --field-selector type=Opaque \
      -o custom-columns=NS:.metadata.namespace,NAME:.metadata.name

    Expect a longer list than you assumed, much of it Helm release data to exclude. What you want is the count a human put there on purpose. Under about thirty, on one cluster, all three are manageable and the choice is preference. Over a hundred, or spread across clusters, the re-commit cost of the two encrypt-into-Git patterns starts to dominate.

  2. Answer the decision questions in order. The first yes decides; the caveat attached to each answer is what you are agreeing to own.

    Decision tree for choosing a GitOps secret pattern: already running a secret manager or rotating frequently leads to External Secrets Operator, trusting the CD tool with a decryption key leads to SOPS, needing a self-contained repository leads to Sealed Secrets, with a fallback panel suggesting workload identity or Vault Agent injection when none of the three fits

  3. Write the decision down before building anything. One paragraph in the platform README: the pattern, the reason, the caveat you accepted, where the key material lives. It stops the choice from being relitigated every quarter, and the next operator reads it first.

  4. Pilot on one namespace. Pick a real but non-critical workload and convert only its secrets. Keep the old Secrets in place until the new path works — the pilot should be reversible by deleting the new resources, not by restoring a backup.

  5. Migrate namespace by namespace, removing the old path as you go. A half-migrated platform, where some secrets come from kubectl apply and some from a controller, is worse than either end state: nobody can tell where a given value came from.

  6. Back up the key material and test the restore. For Sealed Secrets this is not optional:

    kubectl -n kube-system get secret \
      -l sealedsecrets.bitnami.com/sealed-secrets-key \
      -o yaml > sealed-secrets-keys.yaml

    The file holds active and retired private keys, so treat it exactly as you would the secrets themselves — it decrypts all of them. Store it in your own secret manager or offline, never in the repository. For SOPS the equivalent is the age private key or the KMS key policy; for External Secrets there is no key, but the store’s backup and the identity binding become your recovery path.

  7. Rehearse the rebuild. Stand up a scratch cluster, restore the key material, point CD at the repository, and confirm Secrets materialize without anyone typing a password. Whatever you did by hand is your bootstrap procedure — write it into the runbook while you still remember it.

Validate it works

Confirm the Secret was created by the mechanism you chose, not left over from the old path:

kubectl -n apps get secret api-creds \
  -o jsonpath='{.metadata.ownerReferences[*].kind}{"\n"}'

Expect SealedSecret or ExternalSecret. An empty result means the Secret has no owner: it is a leftover, and deleting the source resource will not remove it.

Check the source resource’s own status:

kubectl -n apps get sealedsecret api-creds
kubectl -n apps describe externalsecret api-creds

For a SealedSecret, the object exists and the controller logs show a successful unseal. For an ExternalSecret, the Ready condition should be True with a recent sync time; a False condition carries the provider’s error message, which is almost always the real answer.

For SOPS, confirm the committed file is genuinely encrypted, and that no plaintext slipped into history:

sops filestatus clusters/prod/api-creds.sops.yaml
git log --all -p -- 'clusters/**' | grep -nE '(password|token|apiKey):\s+[A-Za-z0-9]' | head

The first reports whether the file is encrypted. Any hit from the second is a secret to rotate at its source, not a commit to amend — rewriting history does not unpublish a value already cloned.

Troubleshooting

  • The SealedSecret is in the repo but no Secret appears. The controller log says it could not decrypt. Two usual causes: it was sealed against a different cluster’s certificate, or sealed in strict scope and since renamed or moved. Re-seal against the target cluster’s certificate, or with an explicitly wider scope if the secret genuinely needs to move.
  • A rebuilt cluster decrypts nothing. The new controller generated a fresh key pair and your ciphertext was sealed to the old one. Apply the backed-up key Secret into the controller’s namespace and restart the controller. With no backup, the ciphertext is gone and every value has to be regenerated at its source.
  • A SOPS file was committed in plaintext. No creation_rule in .sops.yaml matched the path, so sops created an ordinary file. Fix the path_regex, add a pre-commit hook running sops filestatus over the secrets directory, and rotate the exposed value — the commit is already in everyone’s clone.
  • Flux reports a decryption failure on the Kustomization. Usually the key name inside the referenced Secret: kustomize-controller expects the age private key under a data key ending in .agekey, and a Secret created with a different key name is simply not found. Recreate it with the expected name and let the reconcile retry.
  • ExternalSecret stays not-ready and no Secret is created. Authentication to the store failed. Check the operator’s logs, then the identity path: an IRSA or Workload Identity annotation on the wrong ServiceAccount, a Vault role bound to a different namespace, a token audience mismatch. ESO fails closed, so the symptom is always absence, never a stale value.

When this is the wrong approach

If you are not doing GitOps — no repository as the source of truth, no controller reconciling it — all three add machinery for a problem you do not have. A documented kubectl create secret procedure plus a real secret manager is a coherent answer for a small platform.

More importantly, some values should not become Kubernetes Secrets at all. TLS certificates are better issued by cert-manager than stored anywhere. Database credentials can often be short-lived and issued per-Pod by Vault. Cloud API credentials should usually be replaced outright by workload identity, which removes the secret instead of encrypting it. The best version of this decision is often a shorter list of secrets rather than a better way to encrypt the list you have.

And none of the three protects the value once it lands: all end with a plain Secret in etcd, so encryption at rest and tight get secrets RBAC are the layer underneath this choice, not an alternative to it. For background on the objects themselves, start with ConfigMaps and Secrets.

The authoritative references are the Sealed Secrets repository and the External Secrets Operator documentation; check each for the API version your installed release actually serves before copying any manifest.

If this is the kind of work you’d rather never own again, it’s the daily job of Managed Cloud Ops — book an infrastructure review.