@@ -65,9 +65,10 @@ type HealthCheckConfiguration struct {
6565 // +optional
6666 HealthCheckPath * string `json:"healthCheckPath,omitempty"`
6767
68- // healthCheckPort The port to use to connect with the target.
68+ // healthCheckPort The port the load balancer uses when performing health checks on targets.
69+ // The default is to use the port on which each target receives traffic from the load balancer.
6970 // +optional
70- HealthCheckPort * int32 `json:"healthCheckPort,omitempty"`
71+ HealthCheckPort * string `json:"healthCheckPort,omitempty"`
7172
7273 // healthCheckProtocol The protocol to use to connect with the target. The GENEVE, TLS, UDP, and TCP_UDP protocols are not supported for health checks.
7374 // +optional
@@ -116,6 +117,18 @@ const (
116117 TargetGroupHealthCheckProtocolTCP TargetGroupHealthCheckProtocol = "tcp"
117118)
118119
120+ // +kubebuilder:validation:Enum=HTTP;HTTPS;TCP;TLS;UDP;TCP_UDP
121+ type Protocol string
122+
123+ const (
124+ ProtocolHTTP Protocol = "HTTP"
125+ ProtocolHTTPS Protocol = "HTTPS"
126+ ProtocolTCP Protocol = "TCP"
127+ ProtocolTLS Protocol = "TLS"
128+ ProtocolUDP Protocol = "UDP"
129+ ProtocolTCP_UDP Protocol = "TCP_UDP"
130+ )
131+
119132// +kubebuilder:validation:Enum=http1;http2;grpc
120133type ProtocolVersion string
121134
@@ -125,12 +138,23 @@ const (
125138 ProtocolVersionGRPC ProtocolVersion = "grpc"
126139)
127140
141+ // +kubebuilder:validation:Enum=none;prefer-route-specific;prefer-default
142+ type MergeMode string
143+
144+ const (
145+ MergeModeNone MergeMode = "none"
146+ MergeModePreferRouteSpecific MergeMode = "prefer-route-specific"
147+ MergeModePreferDefault MergeMode = "prefer-default"
148+ )
149+
128150// TargetGroupConfigurationSpec defines the TargetGroup properties for a route.
129151type TargetGroupConfigurationSpec struct {
130152
131153 // targetReference the kubernetes object to attach the Target Group settings to.
132154 TargetReference Reference `json:"targetReference"`
133155
156+ // mergeMode the mode to use for merging the identified per-route configuration and default configuration.
157+
134158 // defaultRouteConfiguration fallback configuration applied to all routes, unless overridden by route-specific configurations.
135159 // +optional
136160 DefaultConfiguration TargetGroupProps `json:"defaultConfiguration,omitempty"`
@@ -141,19 +165,23 @@ type TargetGroupConfigurationSpec struct {
141165}
142166
143167// +kubebuilder:validation:Pattern="^(HTTPRoute|TLSRoute|TCPRoute|UDPRoute|GRPCRoute)?:([^:]+)?:([^:]+)?$"
144- type RouteName string
168+ type RouteIdentifier string
145169
146170// RouteConfiguration defines the per route configuration
147171type RouteConfiguration struct {
148- // name the name of the route, it should be in the form of ROUTE:NAMESPACE:NAME
149- Name RouteName `json:"name "`
172+ // name the identifier of the route, it should be in the form of ROUTE:NAMESPACE:NAME
173+ Identifier RouteIdentifier `json:"identifier "`
150174
151175 // targetGroupProps the target group specific properties
152176 TargetGroupProps TargetGroupProps `json:"targetGroupProps"`
153177}
154178
155179// TargetGroupProps defines the target group properties
156180type TargetGroupProps struct {
181+ // targetGroupName specifies the name to assign to the Target Group. If not defined, then one is generated.
182+ // +optional
183+ TargetGroupName string `json:"targetGroupName,omitempty"`
184+
157185 // ipAddressType specifies whether the target group is of type IPv4 or IPv6. If unspecified, it will be automatically inferred.
158186 // +optional
159187 IPAddressType * TargetGroupIPAddressType `json:"ipAddressType,omitempty"`
@@ -174,10 +202,20 @@ type TargetGroupProps struct {
174202 // +optional
175203 TargetType * TargetType `json:"targetType,omitempty"`
176204
205+ // Protocol [Application / Network Load Balancer] the protocol for the target group.
206+ // If unspecified, it will be automatically inferred.
207+ // +optional
208+ Protocol * Protocol `json:"protocol,omitempty"`
209+
177210 // protocolVersion [HTTP/HTTPS protocol] The protocol version. The possible values are GRPC , HTTP1 and HTTP2
178211 // +optional
179212 ProtocolVersion * ProtocolVersion `json:"protocolVersion,omitempty"`
180213
214+ // EnableMultiCluster [Application / Network LoadBalancer]
215+ // Allows for multiple Clusters / Services to use the generated TargetGroup ARN
216+ // +optional
217+ EnableMultiCluster bool `json:"enableMultiCluster,omitempty"`
218+
181219 // vpcID is the VPC of the TargetGroup. If unspecified, it will be automatically inferred.
182220 // +optional
183221 VpcID * string `json:"vpcID,omitempty"`
@@ -231,6 +269,10 @@ type TargetGroupConfiguration struct {
231269 Status TargetGroupConfigurationStatus `json:"status,omitempty"`
232270}
233271
272+ func (tgConfig * TargetGroupConfiguration ) GetTargetGroupConfigForRoute (name , namespace , kind string ) * TargetGroupProps {
273+ return & tgConfig .Spec .DefaultConfiguration
274+ }
275+
234276// +kubebuilder:object:root=true
235277
236278// TargetGroupConfigurationList contains a list of TargetGroupConfiguration
0 commit comments