How to uniquely address a 'process' in a containerised world? How to uniquely address a 'process' in a containerised world? kubernetes kubernetes

How to uniquely address a 'process' in a containerised world?


After some consideration I believe host+pid is still sufficient (but not necessarily the best way) to identify a process providing you are mindful of the following:

  • whose PID you mean could be ambiguous.It could be the PID of the container's namespace or the host.

  • If you are referring to the process from outside the container you need to use the PID of the host not the PID as it appears inside the container as this is in a separate process namespace. See for example the-curious-case-of-pid-namespaces

  • The container may evem be able to identify the host and PID itself (after all it is supposed to be a sandbox)

  • IP addresses will be relative to the internal network (as normal)

  • hostnames will go via DNS lookup (as normal)

Now a URI refers to a port not a PID so a URI is not appropriate here. PID@HOST is probably a sensible notation but beware confusion with user@host.

In addition to container and pod Ids there are other more convenient ways to identify a processing resource such as stateful sets