Skip to content

Let kube-controllers watch IPReservations - #5115

Open
fasaxc wants to merge 1 commit into
tigera:masterfrom
fasaxc:kube-controllers-watch-ipreservations
Open

Let kube-controllers watch IPReservations#5115
fasaxc wants to merge 1 commit into
tigera:masterfrom
fasaxc:kube-controllers-watch-ipreservations

Conversation

@fasaxc

@fasaxc fasaxc commented Jul 28, 2026

Copy link
Copy Markdown
Member

Description

RBAC change (one verb) to support a Calico change.

The kube-controllers node controller now watches IPReservation on its syncer so it
can publish the new ipam_ippool_reserved metric — how many addresses in each IP pool
an IPReservation covers, and so cannot be assigned. Its ClusterRole grants list on
ipreservations but not watch.

Without watch, the failure is quiet rather than loud: the syncer's List still
succeeds, so the controller reaches in-sync and keeps working, but it re-lists
IPReservations in a tight loop instead of watching them.

Pairs with projectcalico/calico#13331, which carries the
matching change to the Calico chart and static manifests.

Affects: pkg/render/kubecontrollers.

Testing: go test ./pkg/render/kubecontrollers/... passes. No test fixture asserts the
verb list for ipreservations. The behaviour it enables is covered on the Calico side
by a kube-controllers metrics FV that creates an IPReservation after its IP pool and
waits for the metric to change, which only passes if the watch is live.

Release Note

kube-controllers can now watch IPReservations, which it needs to report the ipam_ippool_reserved metric.

For PR author

  • Tests for change.
  • If changing pkg/apis/, run make gen-files
  • If changing versions, run make gen-versions

For PR reviewers

A note for code reviewers - all pull requests must have the following:

  • Milestone set according to targeted release.
  • Appropriate labels:
    • kind/bug if this is a bugfix.
    • kind/enhancement if this is a a new feature.
    • enterprise if this PR applies to Calico Enterprise only.

The node controller now watches IPReservation on its syncer to publish the
ipam_ippool_reserved metric, so its ClusterRole needs `watch` alongside `list`.
Without it the syncer's List still succeeds and the controller still reaches
in-sync, but it re-lists IPReservations in a tight loop instead of watching.

Pairs with projectcalico/calico#13331, which carries
the matching change to the calico chart and static manifests.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@fasaxc
fasaxc marked this pull request as ready for review July 31, 2026 09:02
@fasaxc
fasaxc requested a review from a team as a code owner July 31, 2026 09:02
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