Answers: <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>
  
Answers: CC BY-SA 4.0
Answers: 2021-06-06T19:49:43.840Z
Answers: 2021-06-06T19:49:43.840Z
Answers: Dupinder Singh
Body: <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>
  
Tags: <kubernetes><kubectl>
Title: How to read Kubernets secrets values
UserDisplayName: Dupinder Singh
ThreadText: # 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/<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
  
  **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/<secrets-name> -n <namespace>  -o jsonpath='{.data}'
  
  ```
  
  
  ---
  
  