-
Notifications
You must be signed in to change notification settings - Fork 82
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
release conflicted ip of stateless workload to trigger assigning a new one #3081
release conflicted ip of stateless workload to trigger assigning a new one #3081
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3081 +/- ##
==========================================
+ Coverage 81.07% 81.12% +0.05%
==========================================
Files 50 50
Lines 5358 5373 +15
==========================================
+ Hits 4344 4359 +15
Misses 856 856
Partials 158 158
Flags with carried forward coverage won't be shown. Click here to find out more.
|
1f20326
to
d07922c
Compare
(1) 这应该在 相关 doc 中有说明:对于 无状态 pod,XXXX |
8400439
to
098b161
Compare
37e77f5
to
7efdb15
Compare
7efdb15
to
c2d1c72
Compare
docs/concepts/coordinator.md
Outdated
@@ -57,7 +57,8 @@ For more information about the Underlay Pod not being able to access the Cluster | |||
## Detect Pod IP conflicts(alpha) | |||
|
|||
IP conflicts are unacceptable for underlay networks, which can cause serious problems. When creating a pod, we can use the `coordinator` to detect whether the IP of the pod conflicts, and support both IPv4 and IPv6 addresses. By sending an ARP or NDP probe message, | |||
If the MAC address of the reply packet is not the pod itself, we consider the IP to be conflicting and reject the creation of the pod with conflicting IP addresses: | |||
If the MAC address of the reply packet is not the pod itself, we consider the IP to be conflicting and reject the creation of the pod with conflicting IP addresses. |
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.
这个翻译过来的有点 中式
If the MAC address of the reply packet is belonged to the pod itself, the IP address is recognized as conflicted ....
@windsonsea 给一些建议
pkg/ipam/release.go
Outdated
log := logutils.FromContext(ctx) | ||
|
||
var pod *corev1.Pod | ||
// with IP release, we must need Pod UID |
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.
it needs to offer Pod UID when releasing ip
pkg/ipam/release.go
Outdated
return fmt.Errorf("failed to get the top controller of the Pod %s/%s, error: %v", pod.Namespace, pod.Name, err) | ||
} | ||
|
||
// do not release conflict IPs for stable 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.
do not release conflict IPs for stateful Pod
pkg/ipam/release.go
Outdated
return nil | ||
} | ||
} else { | ||
log.Warn("EnableReleaseConflictIPs is disabled, skip to release IPs") |
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.
is there IP information in the log ?
pkg/ipam/release.go
Outdated
} | ||
} | ||
|
||
// release SpiderEndpoint IPs |
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.
release IP for stateless endpoint
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.
该接口为统一接口,不区分是否为stateless
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.
I seems to be dedicated for stateless endpoint after line 257 , so I mean that the comment could be the following, and help code reviewer a lot
// release IP for stateless endpoint
c2d1c72
to
62004c2
Compare
output, err := frame.DockerExecCommand(ctx, common.VlanGatewayContainer, commandV6Str) | ||
Expect(err).NotTo(HaveOccurred(), "Failed to exec %s for Node %s, error is: %v, log: %v", commandV6Str, common.VlanGatewayContainer, err, string(output)) | ||
} | ||
}) |
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.
need a case for stateful pod whose IP should not be released ? add to the test document and it could be implemented next month
62004c2
to
4ee16d8
Compare
4ee16d8
to
14e2658
Compare
d5d4dd4
to
cb55e3d
Compare
Signed-off-by: Icarus9913 <[email protected]>
cb55e3d
to
c7e0ce3
Compare
Once starting a stateless Pod, the spiderpool will reuse the first allocated IPs from the SpiderEndpoint resource for the Pod if it met some errors. If the coordinator detected the IP conflict, spiderpool will still reuse the conflicted IPs. With this, the Pod would never starts.
So, I added a feature that let coordinator send a signal to spiderpool-agent component to release its whole NICs IPs and let the spiderpool reallocate IPs for the Pod. It might let the Pod starts correctly.
Signed-off-by: Icarus9913 [email protected]