<p>I try to mount a folder that is non-root user(xxxuser) at kubernetes and I use hostPath for mounting. But whenever container is started, it is mounted with user (1001) not xxxuser. It is always started with user (1001). How can I mount this folder with xxxuser ?     </p>

<p>There is many types of volumes but I use hostPath. Before started; I change folder user and group with chown and chgrp commands. And then; mounted this folder as volume. Container started and I checked user of folder but it always user (1001). Such as;</p>

<p>drwxr-x---. 2 1001 1001   70 May  3 14:15 configutil/</p>

<pre><code>volumeMounts:
        - name: configs
          mountPath: /opt/KOBIL/SSMS/home/configutil
      volumes:
      - name: configs
        hostPath:
          path: /home/ssmsuser/configutil
          type: Directory
</code></pre>

<p>drwxr-x---. 2 xxxuser xxxuser 70 May  3 14:15 configutil/</p>

O.Kaplan
<p>You may specify the desired owner of mounted volumes using following syntax:</p>

<pre><code>spec:
  securityContext:
    fsGroup: 2000
</code></pre>
