Add LoadBalancerClass field in service

KEP-1959: https://github.com/kubernetes/enhancements/tree/master/keps/sig-cloud-provider/1959-service-lb-class-field

Kubernetes-commit: 72da0b1bb06607f3f3e067f1bb5ce329ec861e1b
This commit is contained in:
Xudong Liu 2021-01-20 16:56:07 -08:00 committed by Kubernetes Publisher
parent 4f212856ea
commit 32850001d5

View File

@ -43,6 +43,7 @@ type ServiceSpecApplyConfiguration struct {
IPFamilies []corev1.IPFamily `json:"ipFamilies,omitempty"`
IPFamilyPolicy *corev1.IPFamilyPolicyType `json:"ipFamilyPolicy,omitempty"`
AllocateLoadBalancerNodePorts *bool `json:"allocateLoadBalancerNodePorts,omitempty"`
LoadBalancerClass *string `json:"loadBalancerClass,omitempty"`
}
// ServiceSpecApplyConfiguration constructs an declarative configuration of the ServiceSpec type for use with
@ -215,3 +216,11 @@ func (b *ServiceSpecApplyConfiguration) WithAllocateLoadBalancerNodePorts(value
b.AllocateLoadBalancerNodePorts = &value
return b
}
// WithLoadBalancerClass sets the LoadBalancerClass field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the LoadBalancerClass field is set to the value of the last call.
func (b *ServiceSpecApplyConfiguration) WithLoadBalancerClass(value string) *ServiceSpecApplyConfiguration {
b.LoadBalancerClass = &value
return b
}