<p>I have a file named config.txt, which i used to create configmap <strong>myconfig</strong> inside minikube cluster.</p>
<p>However, when I use <strong>myconfig</strong> in a Pod, the name of the file config.txt also shows up as part of the ENV.</p>
<p>How can I correct it?</p>
<pre class="lang-sh prettyprint-override"><code>&gt; cat config.txt
var3=val3
var4=val4

&gt; kubectl create cm myconfig --from-file=config.txt
configmap/myconfig created

&gt; kubectl describe cm myconfig
Name:         myconfig
Namespace:    default
Labels:       &lt;none&gt;
Annotations:  &lt;none&gt;

Data
====
config.txt:
----
var3=val3
var4=val4

Events:  &lt;none&gt;
</code></pre>
<p>Pod definition</p>
<pre class="lang-sh prettyprint-override"><code>&gt; cat nginx.yml 
apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
    run: nginx
  name: nginx
spec:
  containers:
  - image: nginx
    name: nginx
    envFrom:
      - configMapRef:
          name: myconfig
    resources: {}
  dnsPolicy: ClusterFirst
  restartPolicy: Never
status: {}

&gt; kubectl create -f nginx.yml
pod/nginx created
</code></pre>
<p>Pod EVN inspection, notice the line <strong>config.txt=var3=val3</strong>
expected it to be just <strong>var3=val3</strong></p>
<pre class="lang-sh prettyprint-override"><code>&gt; kubectl exec -it nginx -- env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=nginx
TERM=xterm
config.txt=var3=val3
var4=val4

KUBERNETES_PORT_443_TCP=tcp://10.96.0.1:443
KUBERNETES_PORT_443_TCP_PROTO=tcp
KUBERNETES_PORT_443_TCP_PORT=443
KUBERNETES_PORT_443_TCP_ADDR=10.96.0.1
KUBERNETES_SERVICE_HOST=10.96.0.1
KUBERNETES_SERVICE_PORT=443
KUBERNETES_SERVICE_PORT_HTTPS=443
KUBERNETES_PORT=tcp://10.96.0.1:443
NGINX_VERSION=1.19.4
NJS_VERSION=0.4.4
PKG_RELEASE=1~buster
HOME=/root
</code></pre>

bac-Celd
<p>Create configmap like this will do the job:</p>
<pre><code>kubectl create cm myconfig --from-env-file=config.txt
</code></pre>
