<p>Not able to use subPathExpr or subPath in volume when kind is Deployment.</p>

<p>Tried using subpath giving some env variable, but is was not creating the folder with value, it is getting created with ${xyz}</p>

<pre><code>---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: abc
spec:
  replicas: 1
  selector:
    matchLabels:
      app: abc
  template:
    metadata:
      labels:
        app: abc
    spec:
        env:
        - name: NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        volumeMounts:
        - mountPath: /opt/logs
          name: abc
          subPath: $(NAME)
      volumes:
      - name: abc
        hostPath:
          path: /opt/abc
          type: Directory
</code></pre>

<p>i want to create the volume directory with pod hostname, but not able to create</p>

<p>example : 
if pod name is xyzservice-3216544-fv4</p>

<p>i want to create the volume directory like /opt/abc/xyzservice-3216544-fv4</p>

K MAHESH
<p>What's your Kubernetes Cluster Version?<br>
<strong><a href="https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath-with-expanded-environment-variables" rel="nofollow noreferrer">Using subPath with expanded environment variables</a></strong> is a new FEATURE(alpha) in v1.14</p>
