Prerequisites
- A running Kubernetes cluster and configured
kubectlcontext - Flux v2 installed (Flux CLI Install)
- A Git repository (e.g.,
bb-app-source-git) with aninfrastructurebranch
1. Switch to the infrastructure branch
Always ensure your working directory is clean before switching branches.
2. Define the Helm repository
Create aHelmRepository manifest under the bitnami-sealed-secrets directory to let Flux pull the Sealed Secrets charts.
3. Create a Flux Kustomization
In your Flux cluster repo (for example,block-buster/flux-clusters/dev-cluster), scaffold a Kustomization that points to the Sealed Secrets path.
4. Verify the Sealed Secrets controller
The controller is deployed in thekube-system namespace. Run:
A TLS Secret (
kubernetes.io/tls) containing the controller’s key pair is also created in kube-system.
5. Install the kubeseal CLI
Download and install the latest kubeseal binary:
6. Fetch the Sealed Secrets public certificate
You need the controller’s public key to seal secrets locally:sealed-secrets.pub, which you will use to encrypt your Kubernetes Secrets.
7. Seal and commit Kubernetes Secrets
-
Create a plain Secret manifest (
secret.yaml). -
Run:
-
Review, commit, and push
sealed-secret.yamlto your Git repo. Flux will apply it automatically.