Skip to content

Instantly share code, notes, and snippets.

@srkiNZ84
Created September 15, 2019 23:25
Show Gist options
  • Save srkiNZ84/4c6773c1cc67d3a40101bdaa112a1a25 to your computer and use it in GitHub Desktop.
Save srkiNZ84/4c6773c1cc67d3a40101bdaa112a1a25 to your computer and use it in GitHub Desktop.
Bash script/command to get a Secret and decode it
#!/bin/bash
# Usage: ./get_k8s_secret_plaintext SECRET_NAME SECRET_KEY
kubectl get secret $1 -o json | jq -r '.data[$2]' | base64 --decode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment