podiprecovery

package
v1.44.0-0.dev Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

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

func Add

Add wires the controller into the manager.

Types

type Reconciler

type Reconciler struct {
	// contains filtered or unexported fields
}

Reconciler implements reconcile.Reconciler.

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

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).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL