title: Why k8s pod can't find key in ConfigMap?
body: <p>I'm having an issue with a Kubernetes pod that uses a ConfigMap. My pod fails to start, with the following error:</p>
  
  <p><code>Warning  Failed          10s (x7 over 2m16s)  kubelet, docker-desktop  Error: Couldn't find key URL in ConfigMap default/env-config</code></p>
  
  <p>I created my ConfigMap as follows:</p>
  
  <p><code>kubectl create configmap env-config --from-file env-config.yaml</code></p>
  
  <p>This is my ConfigMap:</p>
  
  <pre><code>NAME         DATA   AGE
  env-config   1      5m38s
  Nates-MacBook-Pro:k8s natereed$ kubectl describe configmap env-config
  Name:         env-config
  Namespace:    default
  Labels:       &lt;none&gt;
  Annotations:  &lt;none&gt;
  
  Data
  ====
  env-config.yaml:
  ----
  apiVersion: v1
  kind: ConfigMap
  data:
    AWS_BUCKET: mybucket
    AWS_PROFILE: dev
    AWS_REGION: us-east-2
    JWT_SECRET: foo
    POSTGRESS_DB: &lt;mydb&gt;
    POSTGRESS_HOST: &lt;my host&gt;
    URL: http://localhost:8100  
  metadata:
    name: env-config
  </code></pre>
  
  <p>It looks like command to create the ConfigMap is wrong? It's not clear to me why it creates a map with a single key "env-config.yaml".</p>
  
  <p>The YAML file looks like this:</p>
  
  <pre><code>apiVersion: v1
  kind: ConfigMap
  data:
    AWS_BUCKET: mybucket
    AWS_PROFILE: dev
    AWS_REGION: us-east-2
    JWT_SECRET: foo
    POSTGRESS_DB: mydb
    POSTGRESS_HOST: postgreshost
    URL: http://localhost:8100  
  metadata:
    name: env-config
    namespace: default
  </code></pre>