-
Notifications
You must be signed in to change notification settings - Fork 453
Make missing node IPs in dual-stack mode a hard error #5840
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
Conversation
e90efa4 to
0468fed
Compare
|
I think the diff --git a/pkg/component/worker/kubelet.go b/pkg/component/worker/kubelet.go
index 2287c43d5..666db7025 100644
--- a/pkg/component/worker/kubelet.go
+++ b/pkg/component/worker/kubelet.go
@@ -156,6 +156,8 @@ func (k *Kubelet) Start(ctx context.Context) error {
// addresses in the private function k8s.io/kubernetes/pkg/kubelet.validateNodeIP
// which won't be replicated here.
args["--node-ip"] = ipv4.String() + "," + ipv6.String()
+ } else {
+ return fmt.Errorf("node name IP address lookup didn't return addresses for both families: IPv4: %v, IPv6: %v", ipv4, ipv6)
}
}
alternatively: diff --git a/pkg/component/worker/kubelet.go b/pkg/component/worker/kubelet.go
index 2287c43d5..9c934557e 100644
--- a/pkg/component/worker/kubelet.go
+++ b/pkg/component/worker/kubelet.go
@@ -151,7 +151,10 @@ func (k *Kubelet) Start(ctx context.Context) error {
ipv4, ipv6, err := lookupNodeName(ctx, k.NodeName)
if err != nil {
logrus.WithError(err).Errorf("failed to lookup %q", k.NodeName)
- } else if ipv4 != nil && ipv6 != nil {
+ } else if ipv4 == nil || ipv6 == nil {
+ return fmt.Errorf("node name IP address lookup didn't return addresses for both families: IPv4: %v, IPv6: %v", ipv4, ipv6)
+
+ } else {
// The kubelet will perform some extra validations on the discovered IP
// addresses in the private function k8s.io/kubernetes/pkg/kubelet.validateNodeIP
// which won't be replicated here.But that's just my humble opinion. |
|
This pull request has merge conflicts that need to be resolved. |
|
The PR is marked as stale since no activity has been recorded in 30 days |
|
The PR is marked as stale since no activity has been recorded in 30 days |
|
The PR is marked as stale since no activity has been recorded in 30 days |
|
The PR is marked as stale since no activity has been recorded in 30 days |
4a77bbf to
98dc784
Compare
98dc784 to
26845e0
Compare
|
This pull request has merge conflicts that need to be resolved. |
The networking would be borked in that case, and diagnosing might be hard. Better to be vocal about it, and pointing users to the root cause more quickly. Signed-off-by: Tom Wieczorek <[email protected]>
26845e0 to
efac0a7
Compare
Description
The networking would be borked in that case, and diagnosing might be hard. Better to be vocal about it, and pointing users to the root cause more quickly.
See:
Type of change
How Has This Been Tested?
Checklist