Course contentsShow
← Cloud and Infrastructure
Lesson 2277 of 2,98948. Secrets ManagementFree lesson

Sealed Secrets for GitOps

Learn how Sealed Secrets enable encrypted secrets in Git repositories for GitOps workflows.

Sealed Secrets for GitOps

What you'll learn: How to safely store encrypted Kubernetes secrets directly in Git repositories without exposing sensitive data.

The GitOps Secrets Dilemma

GitOps relies on Git as the single source of truth for infrastructure and applications—but Kubernetes Secrets are only base64-encoded, not encrypted. Committing them to Git exposes credentials to anyone with repository access. You need true encryption that works within a Git-based workflow.

What Are Sealed Secrets?

Sealed Secrets (by Bitnami) solve this by using asymmetric cryptography. A cluster-side controller holds a private key, while you encrypt secrets using a public key. The encrypted SealedSecret resource can be safely committed to Git—only the controller in your specific cluster can decrypt it.

Think of it like a lockbox: you seal secrets with a public padlock that anyone can use, but only the controller has the matching key to open it. Even if someone clones your Git repo, they get encrypted gibberish.

How It Works

  1. Install the controller in your Kubernetes cluster (it generates a key pair)
  2. Use kubeseal CLI to encrypt your Secret manifests locally
  3. Commit the SealedSecret YAML to your Git repository
  4. The controller watches for SealedSecret resources and automatically decrypts them into native Kubernetes Secrets
  5. Your applications consume the resulting Secrets normally via environment variables or volume mounts

The decrypted Secrets exist only in the cluster's etcd—never in Git. You've achieved GitOps compliance without sacrificing security.

When to Use Sealed Secrets

Ideal for teams practicing GitOps with tools like Flux or ArgoCD, where everything must be in Git. It's simpler than External Secrets Operator when you don't need dynamic secrets from Vault or cloud providers—just safe static secrets in version control.

Key Takeaway: Sealed Secrets enable GitOps workflows by encrypting Kubernetes secrets client-side so they can be safely stored in Git repositories, decrypted only by the target cluster's controller.