Skip to content

[ipam/azure] Avoid redundant CiliumNode status writes - #670

Closed
jaredledvina wants to merge 1 commit into
v1.19-ddfrom
jared.ledvina/fixup-azure-ciliumnode-status-deepequal
Closed

[ipam/azure] Avoid redundant CiliumNode status writes#670
jaredledvina wants to merge 1 commit into
v1.19-ddfrom
jared.ledvina/fixup-azure-ciliumnode-status-deepequal

Conversation

@jaredledvina

Copy link
Copy Markdown
Member

On Azure, the operator issued a CiliumNode /status update on essentially every 60s IPAM sync tick for every node, even when nothing changed (~333:1 status:spec write ratio on Azure vs ~2:1 on AWS/ENI). Two things defeated the operator's DeepEqual write-skip gate:

  • AzureInterface.DeepEqual compared three json:"-" fields (vmssName, vmID, resourceGroup) that are never serialized to the apiserver, so a freshly rebuilt in-memory interface always differed from the round-tripped origNode copy.
  • Status.Azure.Interfaces was built from non-deterministic Go map iteration, so its order changed every call and the index-by-index AzureStatus.DeepEqual saw a change even when the interface set was identical.

Changes:

  • Exclude the three non-serialized fields from the generated AzureInterface.DeepEqual (+deepequal-gen=false markers + regeneration).
  • Populate Status.Azure.Interfaces in a deterministic, ID-sorted order via a new AzureStatus.SetInterfaces, with the ordering invariant documented on the field.
  • Rework Azure native-routing CIDR derivation (deriveVpcCIDRs) to select from the interfaces actually backing the node's IPAM pool allocations (multi-subnet aware), with a pinned-interface preference, a deterministic smallest-ID fallback, and explicit logging of skipped/unparseable CIDRs.

Adds unit tests for the deterministic ordering, the DeepEqual field exclusion (round-trip), and the CIDR selection paths. Azure-only; AWS/ENI is unaffected.

Signed-off-by: Jared Ledvina <jared.ledvina@datadoghq.com>
@jaredledvina
jaredledvina force-pushed the jared.ledvina/fixup-azure-ciliumnode-status-deepequal branch from 0d8f36e to 77c3885 Compare July 18, 2026 15:17
@jaredledvina

Copy link
Copy Markdown
Member Author

Superseded by #672 and #673. This PR bundled two logically independent changes on disjoint files, so splitting them for clearer review and independent revertability:

No functional change from this PR — the two branches together reproduce this diff exactly. Closing in favor of #672 and #673.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant