Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add iptables rules for dns in vnet scale cilium case #3400

Merged
merged 5 commits into from
Feb 14, 2025

Conversation

QxBytes
Copy link
Contributor

@QxBytes QxBytes commented Feb 8, 2025

Reason for Change:

In the vnet scale scenario, we use the node's ip as the primary ip instead of an ip from the pod's subnet (what happens in pod subnet mode). In cilium, we add snat rules from the cns, and base our snat on the primary ip + subnet. However, the primary ip is now the node ip, meaning we only snat packets from the node's primary ip w/ the pod subnet cidr. It should be that we also snat packets from the pod subnet's network/cidr. This change modifies the cns to grab any secondary ip from the pod subnet, combine it with the pod subnet cidr, and create an iptable rule for the pod subnet. The cidr is for the whole subnet space (applies to all static ip blocks allocated).

Issue Fixed:

See above

Requirements:

Notes:
Manually tested cilium w/ updated cns and iptable rule(s) are created with pod subnet cidr. DNS traffic succeeds afterwards.

@QxBytes QxBytes added work-in-progress cns Related to CNS. fix Fixes something. vnet-scale PRs related to the Vnet Scale Feature labels Feb 8, 2025
@QxBytes QxBytes self-assigned this Feb 8, 2025
@QxBytes QxBytes force-pushed the alew/vnet-scale-snat branch from 34e01ff to 3227570 Compare February 10, 2025 09:07
@QxBytes QxBytes marked this pull request as ready for review February 10, 2025 22:21
@QxBytes QxBytes requested review from a team as code owners February 10, 2025 22:21
@QxBytes QxBytes requested a review from rbtr February 10, 2025 22:21
@QxBytes QxBytes added release/1.5 Change affects v1.5 release train and removed work-in-progress labels Feb 10, 2025
Copy link
Contributor

@nairashu nairashu left a comment

Choose a reason for hiding this comment

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

Let's replace existing SNAT rules and verify IMDS works if not we might have to update the IMDS rule as well for Vnet Scale in Cillium. Source should be coming from the secondary IPs to use the podsubnet and destination should be ncPrimaryIP for SNAT. For IMDS same source but destination is always HostPrimaryIP

@QxBytes QxBytes force-pushed the alew/vnet-scale-snat branch from 3dcb726 to 75cfcd2 Compare February 12, 2025 03:09
@QxBytes
Copy link
Contributor Author

QxBytes commented Feb 13, 2025

/azp run Azure Container Networking PR

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@QxBytes QxBytes added this pull request to the merge queue Feb 13, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 13, 2025
@QxBytes QxBytes enabled auto-merge February 13, 2025 21:11
@QxBytes QxBytes force-pushed the alew/vnet-scale-snat branch from 75cfcd2 to 8d70f3f Compare February 13, 2025 21:11
@QxBytes
Copy link
Contributor Author

QxBytes commented Feb 13, 2025

/azp run Azure Container Networking PR

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@QxBytes QxBytes added this pull request to the merge queue Feb 13, 2025
Merged via the queue into release/v1.5 with commit fd09882 Feb 14, 2025
82 of 87 checks passed
@QxBytes QxBytes deleted the alew/vnet-scale-snat branch February 14, 2025 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cns Related to CNS. fix Fixes something. release/1.5 Change affects v1.5 release train vnet-scale PRs related to the Vnet Scale Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants