<p>I'm writing a helm chart where I need to supply a <code>nfs.server</code> value for the volume mount from the <code>ConfigMap</code> (<strong>efs-url</strong> in the example below).</p>
<p>There are examples in the docs on how to pass the value from the <code>ConfigMap</code> to env variables or even mount <code>ConfigMaps</code>. I understand how I can pass this value from the <code>values.yaml</code> but I just can't find an example on how it can be done using a <code>ConfigMap</code>.</p>
<p>I have control over this <code>ConfigMap</code> so I can reformat it as needed.</p>
<ol>
<li>Am I missing something very obvious?</li>
<li>Is it even possible to do?</li>
<li>If not, what are the possible workarounds?</li>
</ol>
<pre><code>---
apiVersion: v1
kind: ConfigMap
metadata:
  name: efs-url
data:
  url: yourEFSsystemID.efs.yourEFSregion.amazonaws.com

---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
  name: efs-provisioner
spec:
  replicas: 1
  strategy:
    type: Recreate 
  template:
    metadata:
      labels:
        app: efs-provisioner
    spec:
      containers:
        - name: efs-provisioner
          image: quay.io/external_storage/efs-provisioner:latest
          env:
            - name: FILE_SYSTEM_ID
              valueFrom:
                configMapKeyRef:
                  name: efs-provisioner
                  key: file.system.id
            - name: AWS_REGION
              valueFrom:
                configMapKeyRef:
                  name: efs-provisioner
                  key: aws.region
            - name: PROVISIONER_NAME
              valueFrom:
                configMapKeyRef:
                  name: efs-provisioner
                  key: provisioner.name
          volumeMounts:
            - name: pv-volume
              mountPath: /persistentvolumes
      volumes:
        - name: pv-volume
          nfs:
            server:  &lt;&lt;&lt; VALUE SHOULD COME FROM THE CONFIG MAP &gt;&gt;&gt;
            path: /
</code></pre>

<p>Having analysed the comments it looks like using ConfigMap approach is not suitable for this example as ConfigMap</p>
<blockquote>
<p>is an API object used to store non-confidential data in key-value pairs. Pods can consume ConfigMaps as environment variables, command-line arguments, or as configuration files in a volume.</p>
</blockquote>
<p>To read more about ConfigMaps and how they can be utilized one can visit the <a href="https://kubernetes.io/docs/concepts/configuration/configmap/" rel="nofollow noreferrer">&quot;ConfigMaps&quot; section</a> and the <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/" rel="nofollow noreferrer">&quot;Configure a Pod to Use a ConfigMap&quot; section</a>.</p>
