Repository navigation
[v1.43] Hold bpfKubeProxyHealthzPort=0 until every calico-node accepts it - #5317
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick history
Problem
The operator writes
bpfKubeProxyHealthzPort: 0into FelixConfiguration as soon as BPF is enabled and it is not managing kube-proxy.0is only a valid port for Calico >= v3.32.0 and Enterprise >= v3.23.0-2.0. Oldercalico-nodepods reject it at startup, so during an upgrade — and on a manifest-to-operator migration, where pods still serve out ofkube-system— nodes CrashLoopBackOff and the migration deadlocks.Change
Hold the write until every
calico-nodeis known to accept it:allNodesRunTargetVersionrequires 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 nor.ext, so a localproductVersion()helper supplies the target version using the sameCalicoRelease/EnterpriseReleaseswitch the extension performs onmaster. The test seedsStatus.CalicoVersionfrom 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