<p>I have a problem mounting 2 files in a pod, one is being treated as a directory for some reason (maybe stupid one, but I looked and looked, couldn't find a solution).</p>
<p>in my <code>config</code> folder there's 2 files:</p>
<pre><code>config
|- log4j.properties
|- server.main.properties
</code></pre>
<p>Running <code>StatefulSet</code>, here's the Volumes part of the manifest file:</p>
<pre><code>containers:
 ...
      volumeMounts:
        - mountPath: /usr/local/confluent/config/log4j.properties
          name: log4j-properties
          subPath: log4j.properties
        - mountPath: /usr/local/confluent/config/server.properties
          name: server-properties
          subPath: server.properties
  restartPolicy: Always
  volumes:
    - name: log4j-properties
      configMap:
        name: log4j-properties
        defaultMode: 0777
    - name: server-properties
      configMap:
        name: server-properties
        defaultMode: 0777
volumeClaimTemplates:
- metadata:
    name: confluent-persistent-storage
  spec:
    accessModes:
      - ReadWriteOnce
    resources:
      requests:
        storage: 1Gi
</code></pre>
<p>Created ConfigMaps:</p>
<pre><code>kubectl create configmap server-properties --from-file=config/server.main.properties
kubectl create configmap log4j-properties --from-file=config/log4j.properties
</code></pre>
<p><code>kubectl describe pod</code> gives mounted volumes as:</p>
<pre><code>    Volumes:
  confluent-persistent-storage:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  confluent-persistent-storage-confluent-0
    ReadOnly:   false
  server-properties:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      server-properties
    Optional:  false
  log4j-properties:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      log4j-properties
    Optional:  false
</code></pre>
<p>It's being initialized for 5-6 minutes and in logs I can see that server.properties is not a file, but a folder, and when I exec into pod, I can see that the actual folder is been created instead of file.. What am I doing wrong here?</p>

dejanmarich
<blockquote>
<p>subPath: server.properties</p>
</blockquote>
<p>Wouldn't you want to use it as below?</p>
<blockquote>
<p>subPath: server.main.properties</p>
</blockquote>
