Inspired by https://github.com/ashleyschuett/kubernetes-secret-decode
A python script to decode the data fields of the output of kubectl get secret <secret> -o yaml
(or -o json
) so they are human readable (and copy-paste-able).
Requires python >= 3.10 to run
For development dependencies are managed with pipenv. The dependencies are then frozen in requirements.txt for installation using make freeze-requirements
.
To download the latest release and install through your current Pip run:
curl -L https://github.com/AdamHawtin/kubernetes-secret-decode/archive/v1.0.0.tar.gz --output ./kubernetes-secret-decode-1.0.0.tar.gz
tar xzf kubernetes-secret-decode-1.0.0.tar.gz -C . && pushd kubernetes-secret-decode-1.0.0
make install
popd
Or you can clone the repo then run:
make install
Pipe the output of the kubectl get secret command to ksd
like so
kubectl get secret very-secret-things -o yaml | ksd
Also work with JSON output:
kubectl get secret very-secret-things -o json | ksd
Can also be called on a file like
ksd very-secret-things.json