-
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
try fix fip not work for default vpc #3666
Conversation
从 issue 讨论的日志来看,使用 annotation 也是加的路由
只是被 policy based route 覆盖了? |
Signed-off-by: HuangWei <[email protected]>
Co-authored-by: 张祖建 <[email protected]> Signed-off-by: HuangWei <[email protected]>
use c.config.ClusterRouter instead of defaultVPC const Signed-off-by: HuangWei <[email protected]>
pkg/controller/ovn_fip.go
Outdated
@@ -421,6 +421,28 @@ func (c *Controller) handleUpdateOvnFip(key string) error { | |||
return err | |||
} | |||
// ovn add fip | |||
if vpcName == c.config.ClusterRouter { | |||
// fix issue https://github.com/kubeovn/kube-ovn/issues/3502 |
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.
这个注释删掉吧
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.
Done
pkg/controller/ovn_fip.go
Outdated
klog.Errorf("failed to create config map %s, %v", util.ExternalGatewayConfig, err) | ||
return err | ||
} | ||
externalGwAddr := cm.Data["external-gw-addr"] |
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.
这里直接拿 eip 的 subnet 的 gw, 不然当多公网时,这个数据就不对了。
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.
Done
pkg/controller/ovn_fip.go
Outdated
@@ -457,6 +479,12 @@ func (c *Controller) handleDelOvnFip(key string) error { | |||
} | |||
// ovn delete fip nat | |||
if cachedFip.Status.Vpc != "" && cachedFip.Status.V4Eip != "" && cachedFip.Status.V4Ip != "" { | |||
if cachedFip.Status.Vpc == c.config.ClusterRouter { | |||
match := fmt.Sprintf("ip4.src == %s", cachedFip.Status.V4Ip) |
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.
通过port group和address set同意管理需要出external network的pod的策略路由,不然每多一个fip pod就会多一条规则
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.
感觉合理,后面改改
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.
已经改为 port group 管理了
Signed-off-by: HuangWei <[email protected]>
@a180285 please fix the go-lint issues |
@oilbeater 我看 #2090 最后给了手动解决的办法。这个 PR 还需要合并吗? |
我先关掉吧,后面需要再打开 |
Pull Request
What type of this PR
Examples of user facing changes:
Which issue(s) this PR fixes
Fixes #3502
WHAT
copilot:summary
copilot:poem
HOW
copilot:walkthrough