An example can be found in example/test.env.
Then create a generic secret using the following command:
kubectl create secret generic test-secret \
--namespace=default \
--from-env-file=example/test.env \
--dry-run=client -o yaml > local-toseal/dev/default-test-secret.yaml
The filename structure is extremely important see below:
kubectl create secret generic <secret name> \
--namespace=<namespace> \
--from-env-file=<env file> \
--dry-run -o yaml > <filename>.yaml
Place this file in local-toseal/<env>
To seal secrets for an environment (e.g. bh) simply execute make seal-dev
.
Your original secret will now be in local-sealed/<env>
for reference.
Your new sealed secret will now be in sealed-secrets/<env>
.
This part is self-explanatory.
To locate the SealedSecret
resource, simply execute:
kubectl get sealedsecrets.bitnami.com
NAME AGE
test-secret 29s
To locate the unsealed secret (secret
) resource, simply execute:
kubectl get secrets