<p>We are mounting all the volumes as a non-root user inside the container in a pod using the securityContext. However, for all the configmaps and secrets the volumemount user is still root. I tried the initContainer approach without any success.</p>
<p>I searched on net and didn't get any information on changing the user for the volumemounts for configmaps/secrets as a non-root user. Can anyone please help me here?</p>

Nishant Kansal
<p>Did you create the user in the docker file and uses the below configuration in Kubernetes?</p>
<p>Dockerfile</p>
<pre><code>RUN useradd nonroot -u 10001
USER 10001
</code></pre>
<p>Kubernetes:</p>
<pre><code>securityContext:
  runAsNonRoot: true
  runAsUser: 10001
</code></pre>
