secrets with kubeseal
on the new cluster the state of the cluster is a gitlab project. this includes secrets, just encrypted
the tool
the new cluster has a specific controller on a specific namespace that holds a private key
we use the cli kubeseal which then given a yaml/json format kubectl secrets sends it to that controller, encrypts the fields and returns a yaml or json of a SealedSecret.
This then gets committed and referenced in the deploy jsonnet, the cluster then exports the jsonnet with tanka, applies it and then the cluster decrypts and creates a regular secret.
How to
- have kubeconfig pointing to the correct cluster on which the controller you are targetting is on
cat path/to/secrets.yaml | kubeseal --controller-namespace sealed-secrets --controller-name sealed-secrets > your_sealed_secret.json
- take the content of the secret
- pipes it to kubeseal
- sends it to the sealed secrets controller on the cluster
- writes the retunred sealed secrets into your_sealed_secret.json
- put the resulting file in a folder called sealed-secrets (customary not necessary naming)
- add it in the deploy function