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 |