Skip to content

Commit 2708e16

Browse files
feat: Support deploying Gateway LBs with region property on LoadBalancerConfiguration
Signed-off-by: Aleksander Aleksic <[email protected]>
1 parent 250024d commit 2708e16

26 files changed

+1652
-71
lines changed

apis/gateway/v1beta1/loadbalancerconfig_types.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,20 @@ type LoadBalancerConfigurationSpec struct {
198198
// +optional
199199
MergingMode *LoadBalancerConfigMergeMode `json:"mergingMode,omitempty"`
200200

201+
// region is the AWS region where the load balancer will be deployed. When unset, the controller's default region is used.
202+
// When set to a different region, vpcId, vpcSelector, or loadBalancerSubnets with identifiers must be set so the VPC can be resolved.
203+
// +optional
204+
Region *string `json:"region,omitempty"`
205+
206+
// vpcId is the VPC ID in the target region. Used when region is set (and especially when it differs from the controller default).
207+
// +optional
208+
VpcID *string `json:"vpcId,omitempty"`
209+
210+
// vpcSelector selects the VPC in the target region by tags. Each key is a tag name; the value list is the allowed tag values.
211+
// A VPC matches if it has each tag key with one of the corresponding values. Exactly one VPC must match in the target region.
212+
// +optional
213+
VpcSelector *map[string][]string `json:"vpcSelector,omitempty"`
214+
201215
// +kubebuilder:validation:MinLength=1
202216
// +kubebuilder:validation:MaxLength=32
203217
// loadBalancerName defines the name of the LB to provision. If unspecified, it will be automatically generated.

apis/gateway/v1beta1/zz_generated.deepcopy.go

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/gateway/gateway-crds.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,11 @@ spec:
733733
required:
734734
- capacityUnits
735735
type: object
736+
region:
737+
description: |-
738+
region is the AWS region where the load balancer will be deployed. When unset, the controller's default region is used.
739+
When set to a different region, vpcId, vpcSelector, or loadBalancerSubnets with identifiers must be set so the VPC can be resolved.
740+
type: string
736741
scheme:
737742
description: scheme defines the type of LB to provision. If unspecified,
738743
it will be automatically inferred.
@@ -772,6 +777,19 @@ spec:
772777
type: string
773778
description: Tags the AWS Tags on all related resources to the gateway.
774779
type: object
780+
vpcId:
781+
description: vpcId is the VPC ID in the target region. Used when region
782+
is set (and especially when it differs from the controller default).
783+
type: string
784+
vpcSelector:
785+
additionalProperties:
786+
items:
787+
type: string
788+
type: array
789+
description: |-
790+
vpcSelector selects the VPC in the target region by tags. Each key is a tag name; the value list is the allowed tag values.
791+
A VPC matches if it has each tag key with one of the corresponding values. Exactly one VPC must match in the target region.
792+
type: object
775793
wafV2:
776794
description: WAFv2 define the AWS WAFv2 settings for a Gateway [Application
777795
Load Balancer]

config/crd/gateway/gateway.k8s.aws_loadbalancerconfigurations.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,11 @@ spec:
278278
required:
279279
- capacityUnits
280280
type: object
281+
region:
282+
description: |-
283+
region is the AWS region where the load balancer will be deployed. When unset, the controller's default region is used.
284+
When set to a different region, vpcId, vpcSelector, or loadBalancerSubnets with identifiers must be set so the VPC can be resolved.
285+
type: string
281286
scheme:
282287
description: scheme defines the type of LB to provision. If unspecified,
283288
it will be automatically inferred.
@@ -317,6 +322,19 @@ spec:
317322
type: string
318323
description: Tags the AWS Tags on all related resources to the gateway.
319324
type: object
325+
vpcId:
326+
description: vpcId is the VPC ID in the target region. Used when region
327+
is set (and especially when it differs from the controller default).
328+
type: string
329+
vpcSelector:
330+
additionalProperties:
331+
items:
332+
type: string
333+
type: array
334+
description: |-
335+
vpcSelector selects the VPC in the target region by tags. Each key is a tag name; the value list is the allowed tag values.
336+
A VPC matches if it has each tag key with one of the corresponding values. Exactly one VPC must match in the target region.
337+
type: object
320338
wafV2:
321339
description: WAFv2 define the AWS WAFv2 settings for a Gateway [Application
322340
Load Balancer]

0 commit comments

Comments
 (0)