Kubernetes / kubectl print all secrets Kubernetes / kubectl print all secrets kubernetes kubernetes

Kubernetes / kubectl print all secrets


Sufficiently recent versions of jq have a filter for decoding base64 but it can only be used if the value that was encoded is a valid JSON string.

Anyway, you could start by trying:

.data | map_values(@base64d)


If you need to extract tls certificates and/or keys from a kubernetes secret and you have an older jq version not supporting map_values(@base64d):

kubectl get secrets tls-cert -o json | jq '.data' | cut -d '"' -f 4 | tr -d '{}' | base64 --decode