Skip to content

add source nat setting so udp tests pass on ipv6 cluster - #4795

Merged
zac-nixon merged 1 commit into
kubernetes-sigs:mainfrom
zac-nixon:main
Jun 23, 2026
Merged

zac-nixon merged 1 commit into
kubernetes-sigs:mainfrom
zac-nixon:main

Conversation

@zac-nixon

Copy link
Copy Markdown
Collaborator

Description

Any test that uses a UDP listener fails on an ipv6 cluster, the root cause is that we need to allow for source nating, otherwise the ELB API rejects the configuration. We have to set this value for all subnets in the LB [this is a crazy API setting]. In order to calculate the number of subnets to set the source nat value for, we calculate the unique AZs in the cluster.

Checklist

  • Added tests that cover your change (if possible)
  • Added/modified documentation as required (such as the README.md, or the docs directory)
  • Manually tested
  • Made sure the title of the PR is a good description that can go into the release notes

BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯

  • Backfilled missing tests for code in same general area 🎉
  • Refactored something and made the world a better place 🌟

@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 22, 2026
@kubernetes-prow
kubernetes-prow Bot requested review from shuqz and wweiwei-li June 22, 2026 23:08
@kubernetes-prow kubernetes-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 22, 2026

@shraddhabang shraddhabang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 22, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: shraddhabang, zac-nixon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [shraddhabang,zac-nixon]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@codecov-commenter

codecov-commenter commented Jun 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.31%. Comparing base (82c3870) to head (3387ac9).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4795      +/-   ##
==========================================
+ Coverage   57.08%   57.31%   +0.23%     
==========================================
  Files         396      396              
  Lines       31572    31583      +11     
==========================================
+ Hits        18022    18101      +79     
+ Misses      12492    12418      -74     
- Partials     1058     1064       +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kubernetes-prow kubernetes-prow Bot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 23, 2026

@shraddhabang shraddhabang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 23, 2026
@zac-nixon
zac-nixon merged commit 857c9bb into kubernetes-sigs:main Jun 23, 2026
7 of 9 checks passed
jupdec added a commit to jupdec/aws-load-balancer-controller that referenced this pull request Aug 31, 2026
AWS enforces preserve_client_ip.enabled=true for UDP and TCP_UDP target
groups (`ModifyTargetGroupAttributes` returns InvalidConfigurationRequest
for false, verified against a live IP-target UDP TG). With preserved
client IP, the udp-echoserver backend replies to the actual client
address instead of routing back through the NLB, so the client's socket
drops the reply and the test times out.

The IPv6 workaround in configureIPv6SourceNAT (kubernetes-sigs#4795) sets
SourceNatIPv6Prefix on the LB subnets so replies still transit the NLB.
The LoadBalancerConfiguration CRD has no IPv4 sibling for that field
yet, so there is no equivalent hook available on IPv4 clusters.

Wrap the UDP verification with a helper that no-ops when IPFamily is not
IPv6. This turns the six NLB UDP assertions into pass-through skips on
IPv4 so the surrounding TCP and cross-namespace flow can be exercised.

Remove this shim once SourceNatIpv4Prefix lands in the CRD and
configureIPv6SourceNAT is generalised to cover IPv4.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants