-
Notifications
You must be signed in to change notification settings - Fork 446
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 chassis gc #3525
fix chassis gc #3525
Conversation
Signed-off-by: zhangzujian <[email protected]>
if err != nil { | ||
klog.Errorf("failed to get node %s chassis: %s, %v", node.Name, annoChassisName, err) | ||
return err | ||
} | ||
if chassis == nil { |
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.
这里如果有多个chassis 或者 只有一个chassis 但是和 node name不一致,直接触发 gc。
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.
节点被删除时,chassis 会被删除,但 ovn-controller 还会自动注册一个 chassis,这个 chassis 没有 external-ids:vendor=kube-ovn。后续如果一个同名且同 IP 的节点加入集群,ovn-controller 无法注册新的 chassis。
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.
那就是说两种情况:
- 你说的这种,node之前被清理了,但是 ovn-controller 还在跑或者重新跑,导致有脏记录。 这种node不存在,但是有多余的chassis,现在你的 gcChassis 已经覆盖到了。 但是 node 更新的时候触发gc的逻辑还是有问题,目前没触发到。
- 我清理了整个集群,想快速重建下kube-ovn,可能会出现有两个chassis的情况
if err != nil { | ||
klog.Errorf("failed to get node %s chassis: %s, %v", node.Name, annoChassisName, err) | ||
return err | ||
} | ||
if chassis == nil { |
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.
这里如果有多个chassis 或者 只有一个chassis 但是和 node name不一致,直接触发 gc。
Signed-off-by: zhangzujian <[email protected]>
Signed-off-by: zhangzujian <[email protected]>
Pull Request
What type of this PR
Examples of user facing changes:
Which issue(s) this PR fixes
Fixes #(issue-number)
WHAT
🤖[deprecated] Generated by Copilot at 6904498
Refactor and improve chassis management in
gc.go
andnode.go
. Enhance performance, reliability, and compatibility of garbage collection and chassis tag update functions.🤖[deprecated] Generated by Copilot at 6904498
HOW
🤖[deprecated] Generated by Copilot at 6904498
ListChassis
method to get all chassis instead of filtering by vendor tag (link)chassisNodes
map after finding matching node (link)chassisNodes
map and delete chassis that are not in use by any node (link)GetChassis
method withkubeovnOnly
parameter set to true to get chassis withkube-ovn
vendor tag (link)gcChassis
function and return error if chassis is not registered for node (link)