Node Resource Interface (NRI) is a common framework for plugging
domain or vendor-specific custom logic into container runtime like
containerd. This commit introduces a new congiguration field
`containerd.nri`, providing cluster admins the flexibility to opt
in for this feature in containerd and tune some of its parameters.
By default, NRI is disabled here in accordance with the containerd's
default config file.
Signed-off-by: Feruzjon Muyassarov <feruzjon.muyassarov@intel.com>
If using IPv6 and a kubenet-style CNI (which is more common with
IPv6), we need to support an IPv6 route on the pod, or else Pods will
be unable to reach other Pods.
Co-authored-by: Ciprian Hacman <ciprian@hakman.dev>
Add cluster.Spec.Containerd.SELinuxEnabled field that enables SELinux in
containerd.
With SELinux enabled, all pods that use HostPath volumes must run with
SELinux label `spc_t`, otherwise SELinux denies the pods to touch the host
filesystem.
If the non-masquerade CIDR is not set, take that as an indication that
we don't want masquerade, rather than failing nodeup.
Not setting a non-masquerade CIDR means that we likely won't preserve
pod IPs for pod-to-pod traffic, but likely just means that more
NATting is done than might be needed.
Omitting the value can also be useful if we're using something like
the ip-masq-agent to manage masquerade rules for us.
The containerd command used in
https://github.com/kubernetes/kops/pull/12177 is a modification from
the torcx containerd unit. However, how torcx starts containerd is a
implementation detail and it's better to not hardcode torcx in case it
isn't used anymore.
Change the ExecStard command to use /usr/bin/containerd directly,
making it simpler and more future-proof.
This allows us to set a default containerd config per IG (e.g add a different config for GPU IGs)
Can also be considered a cleanup as we no longer use containerd.overrideConfig as a mechanism for bringing the default containerd config from cloudup to nodeup.
Even if we don't install containerd (e.g. ContainerOS or Flatcar), we
likely still need to configure it; particularly in the case of
kubenet.
Additionally, on ContainerOS we can't change the path from
/etc/containerd/config.toml, so we have to write it there. We may in
future be able to use this on all distros.
Configure kubenet in containerd/CNI mode to match upstream configuration.
Biggest change is a move to the ptp plugin.
Co-authored-by: Ciprian Hacman <ciprian@hakman.dev>