<p>So the answer was so simple I just have to add <code> -o jsonpath='{.data}'</code> at the end of the command</p>
<pre><code>kubectl get secrets/&lt;secrets-name&gt; -n &lt;namespace&gt;  -o jsonpath='{.data}'
</code></pre>

CC BY-SA 4.0
2021-06-06T19:49:43.840Z
2021-06-06T19:49:43.840Z
Dupinder Singh
<p>What could be the <code>kubectl</code> command to see <code>k8s</code> <code>secret</code> values</p>
<p>I tried</p>
<pre><code>kubectl get secrets/&lt;secrets-name&gt; -n &lt;namespace&gt;
</code></pre>
<p>It returns</p>
<pre>
NAME            TYPE     DATA   AGE
secrets1        Opaque   1      18h
</pre>
<p>but I want to know what value stored inside the secret</p>

<kubernetes><kubectl>
How to read Kubernets secrets values
Dupinder Singh
# How to read Kubernets secrets values

(Asked by: username_0 on 2021-06-06)

What could be the kubectl command to see k8s secret values
I tried
kubectl get secrets/ -n 

It returns

NAME            TYPE     DATA   AGE
secrets1        Opaque   1      18h

but I want to know what value stored inside the secret

**Tags:** kubernetes, kubectl


---

## 1 answers

### Answer by username_0 on 2021-06-06. Score: 2

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


---

