<p>I have a Daemonset that places a pod onto all of my cluster's nodes. That pod looks for a set of conditions. When they are found it is supposed to execute a bash script on its node.</p>

<p>Currently my pod that I apply as a daemon set mounts the directory with the bash script. I am able to detect the conditions that I am looking for. When the conditions are detected I execute the bash script but it ends up running in my alpine container inside my pod and not on the host node.</p>

<p>As as simple example of what is not working for me (in spec):</p>

<pre><code>command: ["/bin/sh"]
args: ["-c", "source /mounted_dir/my_node_script.sh"]
</code></pre>

<p>I want to execute the bash script on the NODE the pod is running on, not within the container/pod. How can this be accomplished?</p>

Striar
<p>Actually a command run inside a pod is run on the host. It's a container (Docker), not a virtual machine.</p>

<p>If your actual problem is that you want to do something, which a normal container isn't allowed to, you can run a pod in privileged mode or configure whatever you exactly need.</p>
