mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #39364 from zhouhaibing089/nodeports
Automatic merge from submit-queue nodeports usage should be part of LoadBalancer service type 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.
This commit is contained in:
commit
4d11cbc577
@ -142,7 +142,9 @@ func (p *serviceEvaluator) Usage(item runtime.Object) (api.ResourceList, error)
|
||||
value := resource.NewQuantity(int64(ports), resource.DecimalSI)
|
||||
result[api.ResourceServicesNodePorts] = *value
|
||||
case api.ServiceTypeLoadBalancer:
|
||||
// load balancer services need to count load balancers
|
||||
// load balancer services need to count node ports and load balancers
|
||||
value := resource.NewQuantity(int64(ports), resource.DecimalSI)
|
||||
result[api.ResourceServicesNodePorts] = *value
|
||||
result[api.ResourceServicesLoadBalancers] = *(resource.NewQuantity(1, resource.DecimalSI))
|
||||
}
|
||||
return result, nil
|
||||
|
Loading…
Reference in New Issue
Block a user