Selection criteria for choosing volume mount

Hello everyone,

I have created a cluster using EKS from AWS.

In the cluster I have a Statefulset that requests these 3 mounted volumes.

      volumeMounts:
        - name: test-postfix
          mountPath: /var/test/postfix/data
          subPath: data
        - name: test-postfix
          mountPath: /etc/postfix
          subPath: postfix

Applying the Statefulset creates the Pod with its container and links to a dynamically created EBS volume.

When accessing the container, if I run the df -h command I see that the EBS volume has been mounted on /etc/postfix.

So, what is the criteria here to see on which route is mounting the EBS volume?

Why does it mount in /etc/postfix and not in /var/test/postfix/data? I’ve checked that the order in the yaml doesn’t interfere.

In any case, the information is stored correctly, but I do not know why this procedure.

Excuse me if I didn’t make myself understood correctly and thank you very much for your collaboration.

Best regards,

Alfonso Ruiz-Bravo