What could be the kubectl command to see k8s secret values

I tried

kubectl get secrets/<secrets-name> -n <namespace>

It returns

NAME            TYPE     DATA   AGE
secrets1        Opaque   1      18h

but I want to know what value stored inside the secret

1 Answer 1


So the answer was so simple I just have to add -o jsonpath='{.data}' at the end of the command

kubectl get secrets/<secrets-name> -n <namespace>  -o jsonpath='{.data}'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.