Documentation
¶
Overview ¶
Package podiprecovery contains a small controller that watches Kubernetes Nodes for host-IP changes (the address set the kubelet would put in `status.podIPs` for a hostNetwork pod: InternalIP-preferred, ExternalIP fallback) and deletes operator-managed host-networked pods whose status.podIPs no longer matches that set.
This works around an upstream Kubernetes behavior (https://github.com/kubernetes/kubernetes/issues/93897) where status.podIPs is immutable for hostNetwork pods once set. When a node's IP changes (e.g. after a KubeVirt VM reboot pulls a new DHCP lease), existing hostNetwork pods keep their stale IPs in their status, the Kubernetes EndpointSlice controller advertises the stale IPs, and Felix can't reach Typha. Only deleting and recreating the pod causes the kubelet to populate status.podIPs from the current node IP.
Operator-managed pods are identified by the common.HostNetworkedPodLabel label, which the operator's shared setStandardSelectorAndLabels helper applies to any pod template with spec.hostNetwork == true as a side effect of the normal apply path. The controller additionally verifies spec.hostNetwork == true on each candidate as a safety net before deleting.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Reconciler ¶
type Reconciler struct {
// contains filtered or unexported fields
}
Reconciler implements reconcile.Reconciler.
func (*Reconciler) Reconcile ¶
Reconcile is called for a Node when its host IPs change (or on initial creation). It lists operator-managed pods on the node and deletes any host-networked pod whose status.podIPs doesn't include any of the node's current host IPs (InternalIP-preferred, ExternalIP fallback).