Search code examples
ubuntuamazon-s3kubernetessystemctl

systemctl daemon reload without ssh to the node


I am working on s3 storage and kubernetes technologies and I have a scenario where we need to do a systemctl dameon-reload after the driver binary is copied. How can this be done from a privileged pod without doing ssh to the worker node.


Solution

  • I don't have the code in front of me, but I had great success using CoreOS/go-systemd and volume mounting /var/lib/dbus (IIRC) into a privileged container (as you already mentioned)

    My use case was to do this in a DaemonSet, so every Node did it, but if you wish to target just one node, then spec: nodeName: of the PodSpec would enable you to schedule on that one specific Node

    I will try to remember to update this with a gist containing the tl;dr of the go binary