Skip to content

[v1.44] Hold bpfKubeProxyHealthzPort=0 until every calico-node accepts it - #5315

Merged
caseydavenport merged 1 commit into
release-v1.44from
tomas/bp-5314-v1.44
Sep 15, 2026
Merged

caseydavenport merged 1 commit into
release-v1.44from
tomas/bp-5314-v1.44

Conversation

@tomastigera

Copy link
Copy Markdown
Contributor

Cherry-pick history

Do not merge before #5314 lands on master.

Problem

The operator writes bpfKubeProxyHealthzPort: 0 into FelixConfiguration as soon as BPF is enabled and it is not managing kube-proxy. 0 is only a valid port for Calico >= v3.32.0 and Enterprise >= v3.23.0-2.0. Older calico-node pods reject it at startup, so during an upgrade — and on a manifest-to-operator migration, where pods still serve out of kube-system — nodes CrashLoopBackOff and the migration deadlocks.

Change

Hold the write until every calico-node is known to accept it: allNodesRunTargetVersion requires no pending namespace migration, and either a fresh install with no DaemonSet, or a status reporting both the target variant and the target version. The DaemonSet fetch is hoisted so both the gate and the existing BPF-enabled derivation share it.

The pick applied cleanly. One test fix on top: the spec seeded Status.CalicoVersion from components.CalicoRelease, but this branch's fixture uses Variant: CalicoEnterprise, so the gate compared against the Enterprise release and the positive spec failed. It now seeds from r.ext.ProductVersion(&cr.Spec), which is independent of the fixture and of which variant extension is registered.

Tests

Three specs: held during namespace migration, held while the status still reports an older version, and written once the status reports the target. Mutation-tested — replacing the gate with if true && fails both negative specs.

Suite: 316 passed / 14 failed. All failures are cel_validation_test.go [BeforeEach], which needs envtest binaries (fork/exec /usr/local/kubebuilder/bin/etcd: no such file or directory) that are absent locally; they are environmental and unrelated.

CORE-13540

AI assistance

This PR was written in part with the assistance of generative AI.

Release Note

Fix calico-node CrashLoopBackOff during upgrade when the operator set bpfKubeProxyHealthzPort=0 before all nodes were running a version that accepts it.

The operator defaults FelixConfiguration's bpfKubeProxyHealthzPort to 0 when BPF
is on and it does not manage kube-proxy. 0 is only a valid value for Calico
>= v3.32.0 and Enterprise >= v3.23.0-2.0; older calico-node rejects it at
startup, so upgrading nodes CrashLoopBackOff, and a manifest-to-operator
migration deadlocks because the nodes it has to replace cannot start.

Gate the write on every calico-node already running the version the operator
targets. A fresh install has nothing running and writes immediately; a pending
kube-system migration means manifest-install pods are still serving nodes, so it
waits; otherwise the status has to report both the target variant and version,
which the operator writes together once the stack is available.

The DaemonSet lookup that the bpfEnabled defaulting already did moves up so both
checks share it.

Cherry-pick of projectcalico/calico#13843 (0d65aae5de), which is the same
change in the in-tree copy of this controller.

CORE-13540
Copilot AI lite review requested due to automatic review settings September 14, 2026 21:52
@tomastigera
tomastigera requested a review from a team as a code owner September 14, 2026 21:52
@marvin-tigera marvin-tigera added this to the v1.44.0 milestone Sep 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@caseydavenport
caseydavenport merged commit 02c961a into release-v1.44 Sep 15, 2026
10 checks passed
@caseydavenport
caseydavenport deleted the tomas/bp-5314-v1.44 branch September 15, 2026 12:38
@danudey danudey added the kind/bug Something isn't working label Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants