View Kubernetes secrets
Kubernetes secrets are base64 encoded. To make them human readable, select the value and pipe it to the base64 command.
Decode a specific secret value
kubectl get secret my-app-secrets --template={{.data.password}} | base64 -d
Alternative syntax:
kubectl get secrets/my-app-secrets --template={{.data.password}} | base64 -d
View all secret keys and values
# See all keys
kubectl get secret my-app-secrets -o jsonpath='{.data}'
# Decode all values (concatenated)
kubectl get secret my-app-secrets -o jsonpath='{.data.*}' | base64 -d
Note: The jsonpath {.data.*} approach concatenates all values, which may not be readable if you have multiple secrets.