Created
May 25, 2026 18:25
-
-
Save jrenggli/85071b8d77961deb294f967a7a3afb14 to your computer and use it in GitHub Desktop.
Seal and Inject TLS Certificates into Helm Values
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export KUBECONFIG=~/.kube/mycluster-test.yaml | |
| for E in dev01 dev02 dev03 latest test staging; do | |
| kubectl create secret tls tls-secret \ | |
| --cert=example.com.fullchain.crt \ | |
| --key=example.com.key \ | |
| --dry-run=client \ | |
| --output=yaml \ | |
| | kubeseal \ | |
| --controller-name=sealed-secrets-controller \ | |
| --controller-namespace=kube-system \ | |
| --format=yaml \ | |
| --namespace=myproject-${E} \ | |
| --name=tls-wildcard.example.com-2025-05-17 \ | |
| | yq eval ' | |
| . as $s | | |
| { | |
| "kubernetes": { | |
| "sealedSecrets": { | |
| ($s.metadata.name): { | |
| "encryptedData": $s.spec.encryptedData, | |
| "template": { | |
| "type": $s.spec.template.type | |
| } | |
| } | |
| } | |
| } | |
| } | |
| ' \ | |
| | yq eval-all --inplace 'select(fileIndex==0) *+ select(fileIndex==1)' ../../deployment/helm/${E}.yaml - | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment