Skip to content

Commit b81ab69

Browse files
Merge branch 'kubernetes-sigs:main' into main
2 parents abd690d + e1d32f4 commit b81ab69

24 files changed

+2671
-374
lines changed

.go-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.22.3
1+
1.22.5

Pipfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ name = "pypi"
66
[packages]
77

88
[dev-packages]
9-
mkdocs = "==1.1.2"
10-
mkdocs-material = "==7.1.5"
11-
mike = "==1.0.0"
9+
mkdocs = "==1.6.0"
10+
mkdocs-material = "==9.5.31"
11+
mike = "==2.1.2"
1212

1313
[requires]
14-
python_version = "3.9"
14+
python_version = "3.12"

Pipfile.lock

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

docs/guide/ingress/annotations.md

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -907,35 +907,53 @@ In addition, you can use annotations to specify additional tags
907907

908908
## Addons
909909

910-
!!!note
911-
If waf-acl-arn is specified via the ingress annotations, the controller will make sure the waf-acl is associated to the provisioned ALB with the ingress.
912-
If there is not such annotation, the controller will make sure no waf-acl is associated, so it may remove the existing waf-acl on the ALB provisioned.
913-
If users do not want the controller to manage the waf-acl on the ALBs, they can disable the feature by setting controller command line flags `--enable-waf=false` or `--enable-wafv2=false`
914-
915-
- <a name="waf-acl-id">`alb.ingress.kubernetes.io/waf-acl-id`</a> specifies the identifier for the Amazon WAF web ACL.
910+
- <a name="waf-acl-id">`alb.ingress.kubernetes.io/waf-acl-id`</a> specifies the identifier for the Amazon WAF Classic web ACL.
916911

917912
!!!warning ""
918-
Only Regional WAF is supported.
913+
Only Regional WAF Classic is supported.
914+
915+
!!!note ""
916+
When this annotation is absent or empty, the controller will keep LoadBalancer WAF Classic settings unchanged.
917+
To disable WAF Classic, explicitly set the annotation value to 'none'.
919918

920919
!!!example
921-
```alb.ingress.kubernetes.io/waf-acl-id: 499e8b99-6671-4614-a86d-adb1810b7fbe
922-
```
920+
- enable WAF Classic
921+
```alb.ingress.kubernetes.io/waf-acl-id: 499e8b99-6671-4614-a86d-adb1810b7fbe
922+
```
923+
- disable WAF Classic
924+
```alb.ingress.kubernetes.io/waf-acl-id: none
925+
```
923926

924927
- <a name="wafv2-acl-arn">`alb.ingress.kubernetes.io/wafv2-acl-arn`</a> specifies ARN for the Amazon WAFv2 web ACL.
925928

926929
!!!warning ""
927930
Only Regional WAFv2 is supported.
928931

932+
!!!note ""
933+
When this annotation is absent or empty, the controller will keep LoadBalancer WAFv2 settings unchanged.
934+
To disable WAFv2, explicitly set the annotation value to 'none'.
935+
929936
!!!tip ""
930937
To get the WAFv2 Web ACL ARN from the Console, click the gear icon in the upper right and enable the ARN column.
931938

932939
!!!example
933-
```alb.ingress.kubernetes.io/wafv2-acl-arn: arn:aws:wafv2:us-west-2:xxxxx:regional/webacl/xxxxxxx/3ab78708-85b0-49d3-b4e1-7a9615a6613b
934-
```
935-
940+
- enable WAFv2
941+
```alb.ingress.kubernetes.io/wafv2-acl-arn: arn:aws:wafv2:us-west-2:xxxxx:regional/webacl/xxxxxxx/3ab78708-85b0-49d3-b4e1-7a9615a6613b
942+
```
943+
- disable WAFV2
944+
```alb.ingress.kubernetes.io/wafv2-acl-arn: none
945+
```
946+
936947
- <a name="shield-advanced-protection">`alb.ingress.kubernetes.io/shield-advanced-protection`</a> turns on / off the AWS Shield Advanced protection for the load balancer.
937948

938-
!!!example
939-
```alb.ingress.kubernetes.io/shield-advanced-protection: 'true'
940-
```
949+
!!!note ""
950+
When this annotation is absent, the controller will keep LoadBalancer shield protection settings unchanged.
951+
To disable shield protection, explicitly set the annotation value to 'false'.
941952

953+
!!!example
954+
- enable shield protection
955+
```alb.ingress.kubernetes.io/shield-advanced-protection: 'true'
956+
```
957+
- disable shield protection
958+
```alb.ingress.kubernetes.io/shield-advanced-protection: 'false'
959+
```

helm/aws-load-balancer-controller/templates/deployment.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,17 +170,14 @@ spec:
170170
{{- if .Values.loadBalancerClass }}
171171
- --load-balancer-class={{ .Values.loadBalancerClass }}
172172
{{- end }}
173-
{{- if or .Values.env .Values.envSecretName .Values.envFrom }}
173+
{{- if or .Values.env .Values.envSecretName }}
174174
env:
175175
{{- if .Values.env}}
176176
{{- range $key, $value := .Values.env }}
177177
- name: {{ $key }}
178178
value: "{{ $value }}"
179179
{{- end }}
180180
{{- end }}
181-
{{- if .Values.envFrom }}
182-
{{ .Values.envFrom | toYaml | nindent 8 }}
183-
{{- end }}
184181
{{- if .Values.envSecretName }}
185182
- name: AWS_ACCESS_KEY_ID
186183
valueFrom:
@@ -196,6 +193,10 @@ spec:
196193
optional: true
197194
{{- end }}
198195
{{- end }}
196+
{{- if .Values.envFrom }}
197+
envFrom:
198+
{{- toYaml .Values.envFrom | nindent 10 }}
199+
{{- end }}
199200
securityContext:
200201
{{- toYaml .Values.securityContext | nindent 10 }}
201202
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,9 @@ env:
282282
# envSecretName: aws-secret
283283

284284
# Use envFrom to set environment variables from a Secret or ConfigMap
285-
envFrom:
286-
# valueFrom:
287-
# - secretKeyRef:
288-
# name: aws-load-balancer-controller
285+
# envFrom:
286+
# - secretRef:
287+
# name: my-secret
289288

290289
# Specifies if aws-load-balancer-controller should be started in hostNetwork mode.
291290
# This is required if using a custom CNI where the managed control plane nodes are unable to initiate

mkdocs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ markdown_extensions:
7070
- pymdownx.superfences
7171
- pymdownx.tabbed
7272
- pymdownx.emoji:
73-
emoji_index: !!python/name:materialx.emoji.twemoji
74-
emoji_generator: !!python/name:materialx.emoji.to_svg
73+
emoji_index: !!python/name:material.extensions.emoji.twemoji
74+
emoji_generator: !!python/name:material.extensions.emoji.to_svg
7575
- toc:
7676
permalink: true
7777
extra_css:

pkg/algorithm/slices.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package algorithm
2+
3+
import "cmp"
4+
5+
// RemoveSliceDuplicates returns a copy of the slice without duplicate entries.
6+
func RemoveSliceDuplicates[S ~[]E, E cmp.Ordered](s S) []E {
7+
result := make([]E, 0, len(s))
8+
found := make(map[E]struct{}, len(s))
9+
10+
for _, x := range s {
11+
if _, ok := found[x]; !ok {
12+
found[x] = struct{}{}
13+
result = append(result, x)
14+
}
15+
}
16+
17+
return result
18+
}

pkg/algorithm/slices_test.go

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package algorithm
2+
3+
import (
4+
"testing"
5+
6+
"github.com/stretchr/testify/assert"
7+
)
8+
9+
func Test_RemoveSliceDuplicates(t *testing.T) {
10+
type args struct {
11+
data []string
12+
}
13+
tests := []struct {
14+
name string
15+
args args
16+
want []string
17+
}{
18+
{
19+
name: "empty",
20+
args: args{
21+
data: []string{},
22+
},
23+
want: []string{},
24+
},
25+
{
26+
name: "no duplicate entries",
27+
args: args{
28+
data: []string{"a", "b", "c", "d"},
29+
},
30+
want: []string{"a", "b", "c", "d"},
31+
},
32+
{
33+
name: "with duplicates",
34+
args: args{
35+
data: []string{"a", "b", "a", "c", "b"},
36+
},
37+
want: []string{"a", "b", "c"},
38+
},
39+
}
40+
for _, tt := range tests {
41+
t.Run(tt.name, func(t *testing.T) {
42+
got := RemoveSliceDuplicates(tt.args.data)
43+
assert.Equal(t, tt.want, got)
44+
})
45+
}
46+
}

pkg/deploy/shield/protection_manager_mocks.go

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

0 commit comments

Comments
 (0)