@@ -85,6 +85,26 @@ type Network struct {
85
85
// created for the API Server.
86
86
// +optional
87
87
APIServerForwardingRule * string `json:"apiServerForwardingRule,omitempty"`
88
+
89
+ // APIInternalAddress is the IPV4 regional address assigned to the
90
+ // internal Load Balancer.
91
+ // +optional
92
+ APIInternalAddress * string `json:"apiInternalIpAddress,omitempty"`
93
+
94
+ // APIInternalHealthCheck is the full reference to the health check
95
+ // created for the internal Load Balancer.
96
+ // +optional
97
+ APIInternalHealthCheck * string `json:"apiInternalHealthCheck,omitempty"`
98
+
99
+ // APIInternalBackendService is the full reference to the backend service
100
+ // created for the internal Load Balancer.
101
+ // +optional
102
+ APIInternalBackendService * string `json:"apiInternalBackendService,omitempty"`
103
+
104
+ // APIInternalForwardingRule is the full reference to the forwarding rule
105
+ // created for the internal Load Balancer.
106
+ // +optional
107
+ APIInternalForwardingRule * string `json:"apiInternalForwardingRule,omitempty"`
88
108
}
89
109
90
110
// NetworkSpec encapsulates all things related to a GCP network.
@@ -114,6 +134,24 @@ type NetworkSpec struct {
114
134
LoadBalancerBackendPort * int32 `json:"loadBalancerBackendPort,omitempty"`
115
135
}
116
136
137
+ // LoadBalancerType defines the Load Balancer that should be created.
138
+ type LoadBalancerType string
139
+
140
+ var (
141
+ // External creates a Global External Proxy Load Balancer
142
+ // to manage traffic to backends in multiple regions. This is the default Load
143
+ // Balancer and will be created if no LoadBalancerType is defined.
144
+ External = LoadBalancerType ("External" )
145
+
146
+ // Internal creates a Regional Internal Passthrough Load
147
+ // Balancer to manage traffic to backends in the configured region.
148
+ Internal = LoadBalancerType ("Internal" )
149
+
150
+ // InternalExternal creates both External and Internal Load Balancers to provide
151
+ // separate endpoints for managing both external and internal traffic.
152
+ InternalExternal = LoadBalancerType ("InternalExternal" )
153
+ )
154
+
117
155
// LoadBalancerSpec contains configuration for one or more LoadBalancers.
118
156
type LoadBalancerSpec struct {
119
157
// APIServerInstanceGroupTagOverride overrides the default setting for the
@@ -123,6 +161,15 @@ type LoadBalancerSpec struct {
123
161
// +kubebuilder:validation:Pattern=`(^[1-9][0-9]{0,31}$)|(^[a-z][a-z0-9-]{4,28}[a-z0-9]$)`
124
162
// +optional
125
163
APIServerInstanceGroupTagOverride * string `json:"apiServerInstanceGroupTagOverride,omitempty"`
164
+
165
+ // LoadBalancerType defines the type of Load Balancer that should be created.
166
+ // If not set, a Global External Proxy Load Balancer will be created by default.
167
+ // +optional
168
+ LoadBalancerType * LoadBalancerType `json:"loadBalancerType,omitempty"`
169
+
170
+ // InternalLoadBalancer is the configuration for an Internal Passthrough Network Load Balancer.
171
+ // +optional
172
+ InternalLoadBalancer * LoadBalancer `json:"internalLoadBalancer,omitempty"`
126
173
}
127
174
128
175
// SubnetSpec configures an GCP Subnet.
@@ -278,3 +325,19 @@ type ObjectReference struct {
278
325
// +kubebuilder:validation:Required
279
326
Name string `json:"name"`
280
327
}
328
+
329
+ // LoadBalancer specifies the configuration of a LoadBalancer.
330
+ type LoadBalancer struct {
331
+ // Name is the name of the Load Balancer. If not set a default name
332
+ // will be used. For an Internal Load Balancer service the default
333
+ // name is "api-internal".
334
+ // +kubebuilder:validation:Optional
335
+ // +kubebuilder:validation:Pattern=`(^[1-9][0-9]{0,31}$)|(^[a-z][a-z0-9-]{4,28}[a-z0-9]$)`
336
+ // +optional
337
+ Name * string `json:"name,omitempty"`
338
+
339
+ // Subnet is the name of the subnet to use for a regional Load Balancer. A subnet is
340
+ // required for the Load Balancer, if not defined the first configured subnet will be
341
+ // used.
342
+ Subnet * string `json:"subnet,omitempty"`
343
+ }
0 commit comments