Created
July 2, 2024 14:10
-
-
Save mrsimonemms/52fd78af32626f162851d0e24f4065e8 to your computer and use it in GitHub Desktop.
Extract Kubernetes TLS secrets to YAML
This file contains 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
#!/bin/bash | |
# Extract secrets from all namespaces | |
kubectl get secrets -A --field-selector=type=kubernetes.io/tls -o json | jq -r '.items[]' | yq -p=json | |
# Extract secrets from a single namespace | |
kubectl get secrets -n default --field-selector=type=kubernetes.io/tls -o json | jq -r '.items[]' | yq -p=json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment