Created
April 26, 2023 15:05
-
-
Save aduzsardi/53a38dd1dc341a8e2f872ad28ab7a405 to your computer and use it in GitHub Desktop.
kubectl plugin to base64 decode secrets data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Install: put this in an executable file named `kubectl-decode_secret` , which is in your PATH | |
# Usage: kubectl decode-secret <secret-name> | |
# | |
# Note: the script is using fzf (https://github.com/junegunn/fzf) , for example if you just type `kubectl decode-secret` | |
# it will list the screts and you can select whichever you want | |
kubectl get secret $(kubectl get secret | sed 1d | fzf | awk '{ print $1 }') --template='{{ range $key, $value := .data }}{{ printf "%s: %s\n" $key ($value | base64decode) }}{{ end }}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment