<p>This might be simple, but I can't seem to figure out why a bash script mounted as a configmap cannot be ran as root:</p>

<pre><code>root@myPodId:/opt/nodejs-app# ls -alh /path/fileName 
lrwxrwxrwx 1 root root 18 Sep 10 09:33 /path/fileName  -&gt; ..data/fileName

root@myPodId:/opt/nodejs-app# whoami
root

root@myPodId:/opt/nodejs-app# /bin/bash -c /path/fileName
/bin/bash: /path/fileName: Permission denied
</code></pre>

<p>I'm guessing, but I'd think that as with Docker, the root in the container isn't the actual root and works more like a pseudo-root account.</p>

<p>If that's the case, and the file cannot be ran this way, how would you include the script without having to re-create the Docker container every time the script changes?</p>

<p>See here: <a href="https://github.com/kubernetes/kubernetes/issues/71356#issuecomment-441169334" rel="noreferrer">https://github.com/kubernetes/kubernetes/issues/71356#issuecomment-441169334</a></p>
<p>You need to set the defaultMode on the ConfigMap to the permissions you are asking for:</p>
<pre><code>volumes:
- name: test-script
  configMap:
    name: test-script
    defaultMode: 0777
</code></pre>
