Secure Kubernetes Secrets with kubeseal: Installation & Usage Guide
This article explains how to install kubeseal and its controller, create and encrypt Kubernetes Secret manifests, apply sealed secrets, and provides useful tips on API routes, custom certificates, and RBAC to securely manage secrets in a cloud‑native environment.
Installation
kubeseal binary
wget https://github.com/bitnami-labs/sealed-secrets/releases/download/v0.18.0/kubeseal-0.18.0-linux-amd64.tar.gz
tar -xvf kubeseal-0.18.0-linux-amd64.tar.gz
cp kubeseal /usr/local/bin/
kubeseal --versioncontroller
kubectl apply -f https://github.com/bitnami-labs/sealed-secrets/releases/download/v0.18.0/controller.yaml
# Verify pod
kubectl get pod -n kube-system | grep seal
# Port‑forward
kubectl -n kube-system port-forward svc/sealed-secrets-controller 8080:8080Usage
Create secret manifest
apiVersion: v1
kind: Secret
metadata:
name: secret-example
data:
secret: bXlzdXBlcnNlY3JldAo=Seal the secret
kubeseal --secret-file secret-example.yaml --sealed-secret-file sealed-secret-example.yamlThe generated sealed-secret-example.yaml contains an encrypted spec.encryptedData.secret field.
Apply sealed secret
kubectl create -f sealed-secret-example.yaml
kubectl get sealedsecrets.bitnami.comThe controller decrypts it and creates a regular Secret in the same namespace. You can view it with: kubectl get secret secret-example -o yaml Note: The SealedSecret and the resulting Secret must reside in the same namespace.
Tips
kubeseal provides API routes such as /healthz, /metrics, /v1/verify, /v1/rotate, /v1/cert.pem.
You can supply your own certificate to the controller for easier migration.
Use RBAC to restrict which namespaces and resources users can access, preventing accidental secret leakage.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Raymond Ops
Linux ops automation, cloud-native, Kubernetes, SRE, DevOps, Python, Golang and related tech discussions.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
