-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
nodeports usage should be part of LoadBalancer service type #39364
Conversation
Hi @zhouhaibing089. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with 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. |
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://github.com/kubernetes/kubernetes/wiki/CLA-FAQ to sign the CLA. Once you've signed, please reply here (e.g. "I signed it!") and we'll verify. Thanks.
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. |
0d1e13a
to
381aaab
Compare
I signed it! |
ping @vishh please take a look. |
I'm torn with this PR. Although it is technically correct, from a user standpoint, when they create a external LB they do not know that a Node Port is also being consumed which might confuse users. @derekwaynecarr WDYT? |
well, I have to admit that your concern is totally reasonable. anyway, I would like to clarify the background a little bit more: in some environments(openstack LBaaS as an example), a creation of vip with multiple ports will create multiple vips actually under the hood(the same ip though), so if we really want to limit the ports number, we can either:
@vishh @derekwaynecarr what do you think? |
[APPROVALNOTIFIER] Needs approval from an approver in each of these OWNERS Files: We suggest the following people: |
/lgtm LGTM from the bulk LGTM tool |
@thockin thinks this is fine. So LGTM /lgtm |
Automatic merge from submit-queue |
@zhouhaibing089 sorry, this fell of my radar. this is a behavior change that warrants a release-note. i am not sure i am fully groking the rationale. is this behavior Iaas specific? i would have liked a unit test can you do that as well? |
Disregard, nodeports are allocated on creation so services of type LoadBalancer will always consume nodeports whether they will be used or not. |
added unit testing #42998 |
Automatic merge from submit-queue Unit test quota for nodeport associated with loadbalancer **What this PR does / why we need it**: This PR adds unit tests to ensure node ports associated with loadbalancers are charged to quota appropriately. The original PR that added that feature to quota lacked a unit test (#39364)
Since a creation of Service of type LoadBalancer will allocate NodePorts as well, so it makes more sense to account for the NodePort usage in the LoadBalancer switch case.
check here: https://github.com/kubernetes/kubernetes/blob/master/pkg/registry/core/service/rest.go#L553 for the logic on whether it should assign a nodeport for the service.