One-liner to extract a Kubernetes secret with kubectl
Publish date: 17 May 2025
Several of the pods I deploy on Kubernetes use environment variables for configuration. Our Kubernetes clusters pull the vaults from our secrets repository and store them as Kubernetes secrets. Here’s a one-liner I can never remember to check the value of a particular secret:
As with many of the entries in this blog this is mainly for me but will perhaps be helpful to someone else as well.