-
Notifications
You must be signed in to change notification settings - Fork 40k
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 nodeport repair for ESIPP services #64465
Conversation
This PR is not for the master branch but does not have the |
/assign wojtek-t |
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/retest |
@@ -185,3 +184,19 @@ func (c *Repair) runOnce() error { | |||
} | |||
return nil | |||
} | |||
|
|||
func collectServiceNodePorts(service *api.Service) []int { |
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.
What about modifying the existing method?
kubernetes/pkg/registry/core/service/rest.go
Lines 511 to 520 in 397e661
func CollectServiceNodePorts(service *api.Service) []int { | |
servicePorts := []int{} | |
for i := range service.Spec.Ports { | |
servicePort := &service.Spec.Ports[i] | |
if servicePort.NodePort != 0 { | |
servicePorts = append(servicePorts, int(servicePort.NodePort)) | |
} | |
} | |
return servicePorts | |
} |
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.
The existing func is used in numerous places which expect it to only handle the port nodeports - not the healthcheck nodeport.
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 see, thanks for clarifying.
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.
/lgtm
@@ -185,3 +184,19 @@ func (c *Repair) runOnce() error { | |||
} | |||
return nil | |||
} | |||
|
|||
func collectServiceNodePorts(service *api.Service) []int { |
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 see, thanks for clarifying.
/lgtm |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: MrHohn, nicksardo Assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@nicksardo: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
What this PR does / why we need it:
The nodeport allocation repair controller does not scrape the
Service.Spec.healthCheckNodePort
value and would remove the allocation from memory and etcd after 10 minutes. This opens the door for other services to use the same nodeport and cause collisions.Which issue(s) this PR fixes:
Fixes #54885
Similar to #64349
Release note: