-
Notifications
You must be signed in to change notification settings - Fork 373
Kata does not support hostpid #2633
Comments
cc @bergwolf @gnawux @egernst @jodh-intel The way namespaces are handled in the runtime and agent, this option results in a behaviour silimar to sharePid namespace where all the containers share the Pid namspace of the pause container. |
Hi @amshinde - I don't like the idea of sharing the agent namespace:
I think we should just add this to the limitations document and if someone comes up with a very compelling use-case, we could then consider it. Exposing so much of the host environment to the container does beg the question, "Why not just run |
I agree with @jodh-intel If you want to really expose the host PID, then you probably also need to "fake" If you don't expose the host PID but something else (e.g. guest / agent PID namespace), then whatever bizarre contraption expected the host PID will probably faceplant. What are the actual use cases? I could imagine a few contorted ones (host instrumentation from within a container, that kind of things), or things like a DaemonSet that would monitor some host process. Without a good understanding of the use cases, it would be hard to implement anything sensible. |
@jodh-intel @c3d |
@jodh-intel @c3d @amshinde |
@amshinde has now raised kata-containers/agent#788. If we do this, I think that:
|
This is a debug-only feature and is disabled by default reflected by the value of "enable_agent_pidns" in the configuration.toml which is set to false by default. Allow a container to join the pid namespace of the agent. This is allowed using an environment variable "AGENT_PIDNS". Only if this variable is set and configuration explicitly enabled to allow this, does the runtime set the "agentPidNs" flag in the CreateContainer grpc request sent to the agent. Fixes kata-containers#2633 Signed-off-by: Archana Shinde <[email protected]>
@jodh-intel @bergwolf I have raised #2723 and kata-containers/agent#788 in the runtime and agent repos respectively to address this issue. Please take a look and let me know what you think.
I have addressed all of these in the runtime PR. cc @wenlxie. I know you were interested in the use case as well to run audit containers with pid namespace as the agent. I have come up with this initial implementation. |
This is a debug-only feature and is disabled by default reflected by the value of "enable_agent_pidns" in the configuration.toml which is set to false by default. Allow a container to join the pid namespace of the agent. This is allowed using an environment variable "AGENT_PIDNS". Only if this variable is set and configuration explicitly enabled to allow this, does the runtime set the "agentPidNs" flag in the CreateContainer grpc request sent to the agent. Fixes kata-containers#2633 Signed-off-by: Archana Shinde <[email protected]>
This is a debug-only feature and is disabled by default reflected by the value of "enable_agent_pidns" in the configuration.toml which is set to false by default. Allow a container to join the pid namespace of the agent. This is allowed using an environment variable "AGENT_PIDNS". Only if this variable is set and configuration explicitly enabled to allow this, does the runtime set the "agentPidNs" flag in the CreateContainer grpc request sent to the agent. Fixes kata-containers#2633 Signed-off-by: Archana Shinde <[email protected]>
This is a debug-only feature and is disabled by default reflected by the value of "enable_agent_pidns" in the configuration.toml which is set to false by default. Allow a container to join the pid namespace of the agent. This is allowed using an environment variable "AGENT_PIDNS". Only if this variable is set and configuration explicitly enabled to allow this, does the runtime set the "agentPidNs" flag in the CreateContainer grpc request sent to the agent. Fixes kata-containers#2633 Signed-off-by: Archana Shinde <[email protected]>
This is a debug-only feature and is disabled by default reflected by the value of "enable_agent_pidns" in the configuration.toml which is set to false by default. Allow a container to join the pid namespace of the agent. This is allowed using an environment variable "AGENT_PIDNS". Only if this variable is set and configuration explicitly enabled to allow this, does the runtime set the "agentPidNs" flag in the CreateContainer grpc request sent to the agent. Fixes kata-containers#2633 Signed-off-by: Archana Shinde <[email protected]>
This is a debug-only feature and is disabled by default reflected by the value of "enable_agent_pidns" in the configuration.toml which is set to false by default. Allow a container to join the pid namespace of the agent. This is allowed using an environment variable "AGENT_PIDNS". Only if this variable is set and configuration explicitly enabled to allow this, does the runtime set the "agentPidNs" flag in the CreateContainer grpc request sent to the agent. Fixes kata-containers#2633 Signed-off-by: Archana Shinde <[email protected]>
Kubernetes provides ability for a pod to share host Pid namespace:
https://kubernetes.io/docs/concepts/policy/pod-security-policy/#host-namespaces
Like so:
In Kata, we cannot really share the host Pid namespace due to VM boundary. We could potentially translate this to sharing the pid namespace of the agent.
I am not too inclined for doing this, as this potentially opens up the agent processes. We may just choose not to implement this as list this as a limitation.
The text was updated successfully, but these errors were encountered: