<p>I inherited a Kubernetes/Docker setup, and I accidentally crashed the pod by changing something relating to the DB password.</p>

<p>I am trying to troubleshoot this.</p>

<p>I don't have much Kubernetes or Docker experience, so I'm still learning how to do things.</p>

<p>The value is contained inside the db-user-pass credential I believe, which is an Opaque type secret.</p>

<p>I'm describing it:</p>

<pre><code>kubectl describe secrets/db-user-pass
Name:         db-user-pass
Namespace:    default
Labels:       &lt;none&gt;
Annotations:  &lt;none&gt;

Type:  Opaque

Data
====
password:  16 bytes
username:  13 bytes
</code></pre>

<p>but I have no clue how to get any data from this secret. The example on the Kubernetes site seems to assume I'll have a base64 encoded string, but I can't even seem to get that. How do I get the value for this?</p>

<p>You can use <code>kubectl get secrets/db-user-pass -o yaml</code> or <code>-o json</code> where you'll see the base64-encoded <code>username</code> and <code>password</code>.  You can then copy the value and decode it with something like <code>echo &lt;ENCODED_VALUE&gt; | base64 -D</code> (Mac OS X).</p>
<p>A more compact one-liner for this:</p>
<pre class="lang-sh prettyprint-override"><code>kubectl get secrets/db-user-pass --template={{.data.password}} | base64 -D
</code></pre>
<p>and likewise for the username:</p>
<pre class="lang-sh prettyprint-override"><code>kubectl get secrets/db-user-pass --template={{.data.username}} | base64 -D
</code></pre>
<p>Note: on GNU/Linux, the base64 flag is <code>-d</code>, not <code>-D</code>.</p>
