Skip to content

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

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

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

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.

Adaptations for this branch. The DaemonSet fetch conflicted: this branch still fetches it inline inside setBPFUpdatesOnFelixConfiguration, so the duplicate inline fetch was dropped in favour of the hoisted one. This branch also predates the variant-extension refactor and has no r.ext, so a local productVersion() helper supplies the target version using the same CalicoRelease / EnterpriseRelease switch the extension performs on master. The test seeds Status.CalicoVersion from that same helper rather than hard-coding a constant, so it is independent of the fixture's variant.

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: 299 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

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.

@marvin-tigera marvin-tigera added this to the v1.43.2 milestone Sep 14, 2026
@caseydavenport
caseydavenport merged commit 63043d5 into release-v1.43 Sep 15, 2026
10 checks passed
@caseydavenport
caseydavenport deleted the tomas/bp-5314-v1.43 branch September 15, 2026 12:38
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.

4 participants