<p>I'm currently facing a weird issue with K8S. Indeed I'm creating a container with an envFrom statement and the env variable is pulled from a secret:</p>
<pre><code>envFrom:
  - secretRef:
    name: my-super-secret
</code></pre>
<p>I have created the secret with the base64 encoded value, and when I echo the variable in the container it has added a space at the end, which is quite an issue since it's a password ;-)</p>
<p>Here's my secret:</p>
<pre><code>apiVersion: v1
kind: Secret
metadata:
  name: my-super-secret
data:
  DB_PASSWORD: base64encodedvalue
</code></pre>
<p>Does anyone could provide me with some guidance here ?
I absolutely can't figure out what's happening here ...</p>

moulip
<p>How did you encode the value?</p>
<p>Using this (on Mac)</p>
<pre><code>echo -n &quot;base64encodedvalue&quot; | base64
YmFzZTY0ZW5jb2RlZHZhbHVl
</code></pre>
<p>I can access my values just fine in my Containers, without a trailing space.</p>
<pre><code>echo YmFzZTY0ZW5jb2RlZHZhbHVl | base64 -d
base64encodedvalue
</code></pre>
<p>Source: <a href="https://kubernetes.io/docs/tasks/configmap-secret/managing-secret-using-kubectl/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configmap-secret/managing-secret-using-kubectl/</a></p>
