<p>For some strange and unknown reason, when I use a ConfigMap with key value pairs that will be set as environment variables in the pods (using <code>envFrom</code>), my pods fail to start. </p>

<p>Here is the ConfigMap portion of my YAML:</p>

<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: all-config
data:
  # DB configuration
  dbServer: "host.docker.internal"
  dbPort: "3306"

  # problematic config
  validationQuery: 'Select 1'
</code></pre>

<p>If I comment out the <code>validationQuery</code> key/value pair, the pod starts. If I leave it in, it fails. If I remove the space, it runs! Very strange behavior as it boils down to a whitespace.</p>

<p>Any ideas on why this fails and how users have been getting around this? Can someone try to reproduce?</p>

Chad Van De Hey
<p>I honestly believe that it's something with your application not liking environment variables with spaces. I tried this myself and I can see the environment variable with the space nice and dandy when I shell into the pod/container.</p>

<p>PodSpec:</p>

<pre><code>...
spec:
  containers:
  - command:
    - /bin/sleep
    - infinity
    env:
    - name: WHATEVER
      valueFrom:
        configMapKeyRef:
          key: myenv
          name: j
...
</code></pre>

<hr>

<pre><code>$ kubectl get cm j -o=yaml
apiVersion: v1
data:
  myenv: Select 1
kind: ConfigMap
metadata:
  creationTimestamp: 2018-10-10T20:44:02Z
  name: j
  namespace: default
  resourceVersion: "11111111"
  selfLink: /api/v1/namespaces/default/configmaps/j
  uid: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa
</code></pre>

<hr>

<pre><code>root@mypod-xxxxxxxxxx-xxxxx:/# echo $WHATEVER
Select 1
root@mypod-xxxxxxxxxx-xxxxx:/#
</code></pre>
