diff --git a/api/v1/coherence_types.go b/api/v1/coherence_types.go index 8af35417..6072b63a 100644 --- a/api/v1/coherence_types.go +++ b/api/v1/coherence_types.go @@ -2184,6 +2184,35 @@ type ServiceSpec struct { // This field is alpha-level and is only honored by servers that enable the ServiceLBNodePortControl feature. // +optional AllocateLoadBalancerNodePorts *bool `json:"allocateLoadBalancerNodePorts,omitempty"` + // loadBalancerClass is the class of the load balancer implementation this Service belongs to. + // If specified, the value of this field must be a label-style identifier, with an optional prefix, + // e.g. "internal-vip" or "example.com/internal-vip". Unprefixed names are reserved for end-users. + // This field can only be set when the Service type is 'LoadBalancer'. If not set, the default load + // balancer implementation is used, today this is typically done through the cloud provider integration, + // but should apply for any default implementation. If set, it is assumed that a load balancer + // implementation is watching for Services with a matching class. Any default load balancer + // implementation (e.g. cloud providers) should ignore Services that set this field. + // This field can only be set when creating or updating a Service to type 'LoadBalancer'. + // Once set, it can not be changed. This field will be wiped when a service is updated to a non 'LoadBalancer' type. + // +optional + LoadBalancerClass *string `json:"loadBalancerClass,omitempty"` + // InternalTrafficPolicy describes how nodes distribute service traffic they + // receive on the ClusterIP. If set to "Local", the proxy will assume that pods + // only want to talk to endpoints of the service on the same node as the pod, + // dropping the traffic if there are no local endpoints. The default value, + // "Cluster", uses the standard behavior of routing to all endpoints evenly + // (possibly modified by topology and other features). + // +optional + InternalTrafficPolicy *corev1.ServiceInternalTrafficPolicy `json:"internalTrafficPolicy,omitempty"` + // TrafficDistribution offers a way to express preferences for how traffic + // is distributed to Service endpoints. Implementations can use this field + // as a hint, but are not required to guarantee strict adherence. If the + // field is not set, the implementation will apply its default routing + // strategy. If set to "PreferClose", implementations should prioritize + // endpoints that are in the same zone. + // +featureGate=ServiceTrafficDistribution + // +optional + TrafficDistribution *string `json:"trafficDistribution,omitempty"` } // GetName returns the name of the service. @@ -2246,6 +2275,9 @@ func (in *ServiceSpec) createServiceSpec() corev1.ServiceSpec { spec.IPFamilyPolicy = in.IPFamilyPolicy spec.IPFamilies = in.IPFamilies spec.SessionAffinityConfig = in.SessionAffinityConfig + spec.LoadBalancerClass = in.LoadBalancerClass + spec.InternalTrafficPolicy = in.InternalTrafficPolicy + spec.TrafficDistribution = in.TrafficDistribution } return spec }