Skip to content

Commit 7eb4eb7

Browse files
committed
Add WAFv2ACLArn field to IngressClassParams
1 parent 2b80324 commit 7eb4eb7

File tree

6 files changed

+33
-0
lines changed

6 files changed

+33
-0
lines changed

apis/elbv2/v1beta1/ingressclassparams_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ type IngressClassParamsSpec struct {
174174

175175
// PrefixListsIDs defines the security group prefix lists for all Ingresses that belong to IngressClass with this IngressClassParams.
176176
PrefixListsIDs []string `json:"PrefixListsIDs,omitempty"`
177+
178+
// WAFv2ACLArn specifies ARN for the Amazon WAFv2 web ACL.
179+
// +optional
180+
WAFv2ACLArn string `json:"wafv2AclArn"`
177181
}
178182

179183
// +kubebuilder:object:root=true

config/crd/bases/elbv2.k8s.aws_ingressclassparams.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,9 @@ spec:
268268
- instance
269269
- ip
270270
type: string
271+
wafv2AclArn:
272+
description: WAFv2ACLArn specifies ARN for the Amazon WAFv2 web ACL.
273+
type: string
271274
type: object
272275
type: object
273276
served: true

config/crd/gateway/gateway-crds.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,17 @@ spec:
230230
specifies whether you want the controller to configure security group rules on Node/Pod for traffic access
231231
when you specify securityGroups
232232
type: boolean
233+
minimumLoadBalancerCapacity:
234+
description: MinimumLoadBalancerCapacity define the capacity reservation
235+
for LoadBalancers
236+
properties:
237+
capacityUnits:
238+
description: The Capacity Units Value.
239+
format: int32
240+
type: integer
241+
required:
242+
- capacityUnits
243+
type: object
233244
scheme:
234245
description: scheme defines the type of LB to provision. If unspecified,
235246
it will be automatically inferred.

docs/guide/ingress/ingress_class.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ Cluster administrators can use the optional `inboundCIDRs` field to specify the
196196
If the field is specified, LBC will ignore the `alb.ingress.kubernetes.io/inbound-cidrs` annotation.
197197

198198
#### spec.certificateArn
199+
199200
Cluster administrators can use the optional `certificateARN` field to specify the ARN of the certificates for all Ingresses that belong to IngressClass with this IngressClassParams.
200201

201202
If the field is specified, LBC will ignore the `alb.ingress.kubernetes.io/certificate-arn` annotation.
@@ -283,3 +284,9 @@ Cluster administrators can use `prefixListIDs` field to specify the managed pref
283284

284285
1. If `prefixListIDs` is set, the prefix lists defined will be applied to the load balancer that belong to this IngressClass. If you specify invalid prefix list IDs, the controller will fail to reconcile ingresses belonging to the particular ingress class.
285286
2. If `prefixListIDs` un-specified, Ingresses with this IngressClass can continue to use `alb.ingress.kubernetes.io/security-group-prefix-lists` annotation to specify the load balancer prefix lists.
287+
288+
#### spec.wafv2AclArn
289+
290+
Cluster administrators can use the optional `wafv2AclArn` field to specify ARN for the Amazon WAFv2 web ACL.
291+
Only Regional WAFv2 is supported.
292+
When this annotation is absent or empty, the controller will keep LoadBalancer WAFv2 settings unchanged. To disable WAFv2, explicitly set the annotation value to 'none'.

helm/aws-load-balancer-controller/crds/crds.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,9 @@ spec:
267267
- instance
268268
- ip
269269
type: string
270+
wafv2AclArn:
271+
description: WAFv2ACLArn specifies ARN for the Amazon WAFv2 web ACL.
272+
type: string
270273
type: object
271274
type: object
272275
served: true

pkg/ingress/model_build_load_balancer_addons.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package ingress
22

33
import (
44
"context"
5+
56
"github.com/pkg/errors"
67
"k8s.io/apimachinery/pkg/util/sets"
78
"sigs.k8s.io/aws-load-balancer-controller/pkg/annotations"
@@ -39,6 +40,10 @@ func (t *defaultModelBuildTask) buildWAFv2WebACLAssociation(_ context.Context, l
3940
if rawWebACLARN != "" {
4041
explicitWebACLARNs.Insert(rawWebACLARN)
4142
}
43+
params := member.IngClassConfig.IngClassParams
44+
if params != nil && params.Spec.WAFv2ACLArn != "" {
45+
explicitWebACLARNs.Insert(params.Spec.WAFv2ACLArn)
46+
}
4247
}
4348
if len(explicitWebACLARNs) == 0 {
4449
return nil, nil

0 commit comments

Comments
 (0)