4cab8ed06a
Because they need to prepare the hypervisor networking interfaces and have them match the ones created in the pod networking namespace (typically to bridge TAP and veth interfaces), hypervisor based container runtimes need the sandbox pod networking namespace to be set up before it's created. They can then prepare and start the hypervisor interfaces when creating the pod virtual machine. In order to do so, we need to create per pod persitent networking namespaces that we pass to the CNI plugin. This patch leverages the CNI ns package to create such namespaces under /var/run/netns, and assign them to all pod containers. The persitent namespace is removed when either the pod is stopped or removed. Since the StopPodSandbox() API can be called multiple times from kubelet, we track the pod networking namespace state (closed or not) so that we don't get a containernetworking/ns package error when calling its Close() routine multiple times as well. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> |
||
---|---|---|
.. | ||
apparmor | ||
seccomp | ||
config.go | ||
container.go | ||
container_attach.go | ||
container_create.go | ||
container_exec.go | ||
container_execsync.go | ||
container_list.go | ||
container_portforward.go | ||
container_remove.go | ||
container_start.go | ||
container_status.go | ||
container_stop.go | ||
container_updateruntimeconfig.go | ||
image_list.go | ||
image_pull.go | ||
image_remove.go | ||
image_status.go | ||
runtime_status.go | ||
sandbox.go | ||
sandbox_list.go | ||
sandbox_remove.go | ||
sandbox_run.go | ||
sandbox_status.go | ||
sandbox_stop.go | ||
server.go | ||
utils.go | ||
version.go |