add ksecret utility script
This commit is contained in:
parent
1a51cb7c2a
commit
ff57f07a37
1 changed files with 12 additions and 0 deletions
12
bin/ksecret
Executable file
12
bin/ksecret
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
if [ "$#" -lt 2 ]; then
|
||||||
|
echo "Usage: ${0} [kubectl options] secret key"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
secret="${@:$(($#-1)):1}"
|
||||||
|
key="${@:$(($#)):1}"
|
||||||
|
|
||||||
|
set -- "${@:1:$(($#-2))}"
|
||||||
|
kubectl get secret "$@" "${secret}" -o "go-template={{index .data \"${key}\"}}" | base64 -d
|
Loading…
Reference in a new issue