Tank.Runtime.Network (Tank v0.1.0)

Copy Markdown View Source

Configures a pod's network namespace at the Linx.Process :ready checkpoint. A pod's :network is one of:

  • :host — the workload shares the host's network namespace (the runtime simply doesn't give it a fresh :net ns), so there is nothing to do here.
  • :none — an isolated netns with loopback only.
  • %Tank.Pod.Network{} — loopback plus one or more %Tank.Nic{}.

Each macvlan NIC is created in the host netns over its parent uplink, then moved into the container's netns, and renamed / addressed / brought up there — a macvlan can't be created directly in the container over a parent that lives in the host netns. The host-side name is transient because the final name (e.g. eth0) usually collides with a host interface.

DNS (/etc/resolv.conf) is materialised by the orchestrator (Tank.Runtime) during rootfs setup, not here.

Summary

Functions

Configure the netns of the container parked at host_pid.

Functions

setup(host_pid, arg2)

@spec setup(pos_integer(), Tank.Pod.Network.t() | :host | :none) ::
  :ok | {:error, term()}

Configure the netns of the container parked at host_pid.