<p>The nodeSelectorTerms in a PersistentVolume help the volume identify which node to bind to. For example:</p>
<pre><code>nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: kubernetes.io/hostname
          operator: In
          values:
          - mynodename
</code></pre>
<p>means that we only want to bind to a node of the name <code>mynodename</code>.</p>
<p>I would like to replace <code>mynodename</code> with a variable defined in a configMap. For example, the following syntax is what I was imagining, but it does not work:</p>
<pre><code>nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: kubernetes.io/hostname
          operator: In
          values:
          - valueFrom:
              configMapKeyRef:
                name: my-configmap
                key: MYNODENAME
</code></pre>
<p>where <code>my-configmap</code> is a configmap and <code>MYNODENAME</code> is a variable in it.</p>
<p>Can I achieve this somehow?</p>

<p>This is not supported. Apparently I need more words than just that.</p>
