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 default route on delegatedNIC interface #3109

Merged
merged 8 commits into from
Nov 13, 2024

Conversation

paulyufan2
Copy link
Contributor

@paulyufan2 paulyufan2 commented Nov 6, 2024

Reason for Change:

This PR is to fix one issue in swiftv2 Windows scenario:
When a pod is created, the default route is added on infra vnet:
root@swiftv2-pod-3:/# ip route
default via 10.244.2.1 dev eth0 metric 1
It leads to ping a VM IP in the same VNET that cannot work.

There are two issues::
1.CNS does not provide the default route to CNI;
2.CNI should only add the default route to secondary interface customer vnet; on Swiftv2 scenario, skipDefaultRoutes is set to true for infraNIC interface and false for a secondary interface; so if !info.skipDefaultRoutes, then add default route.

Add dummy default route and pass to CNI as a workaround;

After this fix after a pod creation is done, the route table shows:
root@swiftv2-pod-1:/# ip route
default via 10.241.0.1 dev eth1

10.241.0.0/16 dev eth1 proto kernel scope link src 10.241.0.55
10.244.0.0/16 dev eth0 proto kernel scope link src 10.244.1.103

Issue Fixed:

Requirements:

Notes:

@paulyufan2 paulyufan2 added the cns Related to CNS. label Nov 6, 2024
@paulyufan2 paulyufan2 requested a review from a team as a code owner November 6, 2024 19:25
@paulyufan2 paulyufan2 requested review from timraymond, kmurudi and tamilmani1989 and removed request for timraymond November 6, 2024 19:25
@paulyufan2
Copy link
Contributor Author

/azp run Azure Container Networking PR

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@paulyufan2
Copy link
Contributor Author

/azp run Azure Container Networking PR

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

aggarwal0009
aggarwal0009 previously approved these changes Nov 7, 2024
@paulyufan2
Copy link
Contributor Author

/azp run Azure Container Networking PR

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@paulyufan2
Copy link
Contributor Author

/azp run Azure Container Networking PR

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

kmurudi
kmurudi previously approved these changes Nov 11, 2024
isaac-dasan
isaac-dasan previously approved these changes Nov 12, 2024
rbtr
rbtr previously approved these changes Nov 12, 2024
cns/middlewares/k8sSwiftV2_linux.go Outdated Show resolved Hide resolved
Co-authored-by: Evan Baker <[email protected]>
Signed-off-by: Paul Yu <[email protected]>
@paulyufan2 paulyufan2 dismissed stale reviews from rbtr and isaac-dasan via fe827fb November 12, 2024 20:37
@paulyufan2
Copy link
Contributor Author

/azp run Azure Container Networking PR

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@paulyufan2 paulyufan2 added this pull request to the merge queue Nov 12, 2024
Merged via the queue into master with commit 42aea15 Nov 13, 2024
14 checks passed
@paulyufan2 paulyufan2 deleted the addDefaultRouteonCNS branch November 13, 2024 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cns Related to CNS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants