Skip to main content
In this guide, you’ll learn how to manage Kubernetes secrets securely using Bitnami Sealed Secrets in a GitOps workflow powered by Flux. By the end, you’ll have encrypted Secret manifests stored safely in Git and automatically decrypted in your cluster.

1. Declarative Secret Storage

According to GitOps principles, all Kubernetes resources—including secrets—should live as code in your Git repository.

Creating a Standard Secret

Base64 encoding is not secure encryption. Never commit raw or Base64‐encoded secrets to Git.

2. Secret Management Solutions

Compare popular tools for encrypting Kubernetes secrets in GitOps repositories: In this article, we’ll focus on Bitnami Sealed Secrets.

3. What Are Bitnami Sealed Secrets?

Bitnami Sealed Secrets provides:
  • A Kubernetes controller that decrypts sealed secrets inside the cluster.
  • A kubeseal CLI to encrypt Kubernetes Secret manifests to SealedSecret manifests.
  • A safe-to-commit SealedSecret format (even on public repos) that only your controller can decrypt.

4. Installing the Sealed Secrets Controller with Flux

Deploy the controller as a HelmRelease in Flux:
Flux will pull the chart and install the Sealed Secrets controller into the kube-system namespace.

5. Encrypting a Secret with kubeseal

Follow these steps to seal your plain Secret:
  1. Generate the plain Secret manifest (if not already done):
  2. Install the kubeseal client:
  3. Fetch the public certificate from the controller:
  4. Seal the Secret:
The --scope cluster-wide flag allows decryption in any namespace. Omit or change the scope for namespace-restricted secrets.

6. Example Manifests

6.1 Original Kubernetes Secret

6.2 Resulting SealedSecret

7. Applying the SealedSecret with Flux

  1. Commit mysql-password_sealedsecret.yaml to your Git repo.
  2. Flux syncs and applies the SealedSecret resource.
  3. The Sealed Secrets controller in the cluster decrypts it and creates a standard Kubernetes Secret.
  4. Your workloads can reference the decrypted Secret just like any other.

8. Summary

By integrating Bitnami Sealed Secrets with Flux, you get:
  • Encrypted Secret manifests stored safely in Git.
  • Automated HelmRelease deployment of the Sealed Secrets controller.
  • CLI-driven encryption (kubeseal) and in-cluster decryption.
  • A fully GitOps-friendly secret management workflow for Kubernetes.

Watch Video