I have a Kubernetes cluster (Docker and containerd) where I deployed the Weave CNI plugin.
When inspecting the master node processes (ps -aef --forest
) I can see that the containerd-shim
process that runs the weave plugin has 3 processes in it's tree:
31175 16241 \_ containerd-shim -namespace moby -workdir /var/lib/containerd/io.containerd.runtime.v1.linux/moby/836489.. -address /run/containerd/contai
31199 31175 | \_ /bin/sh /home/weave/launch.sh
31424 31199 | | \_ /home/weave/weaver --port=6783 --datapath=datapath --name=36:e4:33:8
31656 31175 | \_ /home/weave/kube-utils -run-reclaim-daemon -node-name=ubuntu -peer-name=36:e4
What I fail to understand is how the kube-utils
process (pid 31656), which is issued from the launch.sh
script process (pid 31199) is a sibling process of it and not a child process?
I have tried to create a similar environment to emulate this scenario, by creating a docker image from the following:
FROM ubuntu:18.04
ADD ./launch.sh /home/temp/
ENTRYPOINT ["/home/temp/launch.sh"]
Where launch.sh
in my case is similar in the idea to that of weave:
#!/bin/sh
start() {
sleep 2000&
}
start &
sleep 4000
After deploying this to the cluster I get the following process tree:
114944 16241 \_ containerd-shim -namespace moby -workdir /var/lib/containerd/io.containerd.runtime.v1.linux/moby/d9a6904 -address /run/containerd/contai
114972 114944 \_ /bin/sh /home/temp/launch.sh
115002 114972 \_ sleep 4000
115003 114972 \_ sleep 2000
And you can see that both processes are children of the main container process and not a sibling.
According to the weave scenario above, I would expect that the sleep 2000
process would be a sibling to the launch.sh
process and not a child.
Any idea how to explain the weave situation above? how can I reproduce this locally? or in what scenario is a sibling process created to the container process?
Thank you all.