I wanted to understand if a sidecar container can send a unix signal to the main container process).
The use-case is I have Nginx running as the main content serving app container and I want the sidecar container to receive Nginx config updates and reload Nginx by sending a signal. These two containers would be running in a single pod.
PS: I don't have an environment to try this out but wanted to check if people have used such a pattern?
You can share process namespace by setting shareProcessNamespace: true
.
The Kubernetes documentation has an example where a sidecar sends a SIGHUP
to an nginx container in the same pod: Share Process Namespace between Containers in a Pod. As shown in the example, you might to add some capabilities to the container.