Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Decode kubernetes base64 secrets
# Print decoded kubernetes secrets
# kubectl secrets nameofsecret -o json |
cat > $tmp
keys=$(cat $tmp| jq -ra '.data | to_entries[] | .key')
for key in $keys; do
value=$(cat $tmp | jq -r '.data."'$key'"' | base64 -d)
echo "$key: $value"
rm $tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.