Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Decode kubernetes base64 secrets
# Print decoded kubernetes secrets
# kubectl secrets nameofsecret -o json | kubernetes_raw_secrets.sh
tmp=$(mktemp)
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"
done
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.