-
Notifications
You must be signed in to change notification settings - Fork 77
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
Fixed the issue of IP resources being exhausted when using multiple NICs #4359
base: main
Are you sure you want to change the base?
Conversation
e9fbecf
to
94c0ea0
Compare
pkg/ipam/allocate.go
Outdated
@@ -505,6 +505,11 @@ func (i *ipam) allocateIPFromCandidate(ctx context.Context, c *PoolCandidate, ni | |||
continue | |||
} | |||
|
|||
if ip == nil || ip.Address == 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.
ip == nil || ip.Address == nil 为什么代表 “ its UID %s already exists in pool ”
并且 break
这块的代码可读性 不高
94c0ea0
to
56fff92
Compare
pkg/ippoolmanager/ippool_manager.go
Outdated
@@ -115,6 +115,11 @@ func (im *ipPoolManager) AllocateIP(ctx context.Context, poolName, nic string, p | |||
if err != nil { | |||
return err | |||
} | |||
if allocatedIP == nil { | |||
// The Pod has already obtained an IP address in the pool. | |||
// We skip this allocation and return 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.
从这个 api 定义来看,为什么不是 把 分配的 ip return 出去,或者 在 相关的 return error 参数中 说明这种 case
而是用 ip为空 这种 非常有歧义的 方式来代表 ip 已经分配了
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.
嗯。
Signed-off-by: tao.yang <[email protected]>
56fff92
to
b429b11
Compare
Thanks for contributing!
Notice:
"release/none"
"release/bug"
"release/feature"
What issue(s) does this PR fix:
Fixes #
Special notes for your reviewer:
Problem 1:
When ipam.spidernet.io/ippools does not specify an interface name, the network card information recorded in spiderEndpoint is incorrect.
Problem 2:
IP resources are exhausted,The 4102bd95-8f63-4f66-9b64-d7050e91b6c5 UID occupies IP resources indefinitely.
Problem 3:
Statefulset cannot be created without NICs