-
Notifications
You must be signed in to change notification settings - Fork 456
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
update policy route when subnet cidr is changed #3587
Conversation
4b595fa
to
0b1c6a7
Compare
0b1c6a7
to
076d09f
Compare
pkg/controller/subnet.go
Outdated
@@ -2957,3 +2968,67 @@ func (c *Controller) clearOldU2OResource(subnet *kubeovnv1.Subnet) error { | |||
} | |||
return nil | |||
} | |||
|
|||
func (c *Controller) checkAndDeleteUnusedPolicyRouteForSubnet(subnet *kubeovnv1.Subnet, isCommonRoute bool) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
common route 指的是什么
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对于每个子网,创建后都会添加一条 ip4.dst == subnet.spec.Cidr 或者 ip6.dst == subnet.spec.Cidr,优先级为 31000,action 为 allow 的策略路由,这条路由在添加的时候,调用的function 为 addCommonRoutesForSubnet,所以认为这条路由是 commonPolicyRoute
另外,还会根据子网是 分布式或者集中式,分布式添加 ip4.src == subnet.node portgroup 29000 allow 的路由,集中式添加 ip4.src == subnet.spec.cidr 29000 allow 的路由,这两条路由是和具体子网类型相关的,不是每个子网都添加一样的策略路由,所以这两条认为是 非commonRoute 的路由
Signed-off-by: 马洪贞 <[email protected]>
076d09f
to
82e60c6
Compare
Signed-off-by: 马洪贞 <[email protected]>
Signed-off-by: 马洪贞 <[email protected]>
Pull Request
What type of this PR
Which issue(s) this PR fixes
Fixes #(issue-number)
WHAT
copilot:summary
copilot:poem
HOW
copilot:walkthrough