Skip to content

Instantly share code, notes, and snippets.

@afirth
Last active April 19, 2020 07:39
Show Gist options
  • Save afirth/1b532e92711caa2f1fd5f98ee516f855 to your computer and use it in GitHub Desktop.
Save afirth/1b532e92711caa2f1fd5f98ee516f855 to your computer and use it in GitHub Desktop.
kubectl view all secrets in namespace
#requires jq >= 1.6
k get secret -o json -n <namespace> | jq -r '.items[] | [.metadata.name, (.data |map_values(@base64d) )]'
# only keys
k get secret -o json -n <namespace> | jq -r '.items[] | [.metadata.name, (.data |map_values(@base64d) )] | to_entries | .[] | [.value] ' | grep ':'
# better format
k get secret -o json -n accounts-web | jq -r '.items[] | [.metadata.name, (.data |map_values(@base64d) )]' | grep --color=never -P '\w'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment