Skip to content

Write shared configuration through server-side apply - #5324

Merged
caseydavenport merged 4 commits into
tigera:release-v1.44from
caseydavenport:casey-managedfields-v133
Sep 22, 2026
Merged

caseydavenport merged 4 commits into
tigera:release-v1.44from
caseydavenport:casey-managedfields-v133

Conversation

@caseydavenport

@caseydavenport caseydavenport commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Description

Backport of projectcalico/calico#13944 to v3.33, rebuilt by hand because the operator code moved repos between the two.

Moves the installation controller's FelixConfiguration and BGPConfiguration writes onto server-side apply, so which fields belong to the operator is recorded in managed fields instead of in an annotation the operator maintains itself.

  • Each write site owns a named set of fields, and per field it either defers to a user's edit, overrides it, or degrades the Installation status.
  • Every field is declared on every reconcile, instead of only when the Installation asks for it, because an owner that stops declaring a field deletes it. That is what makes a removed field get taken back rather than stranded.
  • Both API groups write the same way. On aggregated-apiserver clusters the operator applies to crd.projectcalico.org/v1 directly, where the API server tracks ownership exactly as it does for v3.
  • Fields the operator wrote before this change are recorded as updates rather than applies. The apply path recognizes that older manager name, so the first apply takes ownership back from it.
  • The annotations older operators used to record their own writes are read once, to resolve that first apply, and deleted once no declared field still needs them.
  • Cluster route programming moves in lockstep across both resources. Felix and BIRD have to give it up together, since one retracting alone leaves both of them programming the IPIP routes.

Differences from the upstream change, all forced by this branch:

  • Go is 1.26 here, which has no type parameters on methods, so the apply entry point is a generic free function rather than a method on the field manager.
  • The variant extension's FelixConfiguration hook changes shape, from mutating the resource to declaring the fields it owns. The Enterprise dnsTrustedServers default moves with it.
  • FelixConfiguration and BGPConfiguration join the manager's uncached list in cmd/main.go, since this branch has no pkg/daemon.
  • There is no deps.txt here, so the new package needs no generated-file update.

Behavior changes worth a look during review:

  • eBPF mode gets written as explicitly disabled in cases where the operator previously wrote nothing at all, except while a kube-system migration is still in flight, where the operator stays out of the field entirely.
  • The eBPF kube-proxy health port is cleared when a cluster leaves eBPF mode, restoring Felix's own default instead of leaving it pinned at zero.
  • Restoring the v3 metadata a CRD-backed resource carries now merges it over the resource's own labels and annotations, matching how libcalico-go presents the same object on the v3 API.

A second commit regenerates the imported CRDs and admission policies. That drift comes from the release-v3.33 branch this repo pins, not from this change - it reproduces on a clean release-v1.44 - but the file generation check fails without it.

make ut passes across all 47 controller suites.

Related: CORE-13698

Release Note

Fixes the operator leaving stale cluster route programming settings behind in FelixConfiguration and BGPConfiguration when the Installation stops asking for them.
Fixes the operator leaving Felix's eBPF kube-proxy health port pinned at zero after a cluster leaves eBPF mode.
The operator now records the FelixConfiguration and BGPConfiguration fields it owns in managed fields, and removes the annotations earlier versions used for the same purpose.

AI assistance: Claude Code

By opening this PR you take responsibility for every line in it, and you agree to explain the change yourself during review rather than routing review comments back through an agent.

The installation controller declares the FelixConfiguration and BGPConfiguration fields it owns, and the API server tracks ownership of each one.
Copilot AI lite review requested due to automatic review settings September 21, 2026 22:01
@caseydavenport
caseydavenport requested a review from a team as a code owner September 21, 2026 22:01

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.44.0 milestone Sep 21, 2026
Generated from the branch the operator pins, which moved since the last sync.
Copilot AI review requested due to automatic review settings September 21, 2026 23:09

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.

Calico ships three mutating admission policies and three bindings.
Copilot AI review requested due to automatic review settings September 21, 2026 23:37

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.

Calico ships three mutating admission policies and three bindings.
Copilot AI review requested due to automatic review settings September 22, 2026 00:19

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 1017cf8 into tigera:release-v1.44 Sep 22, 2026
3 checks passed
@caseydavenport
caseydavenport deleted the casey-managedfields-v133 branch September 22, 2026 15:55
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.

3 participants