Skip to content

Commit 094b903

Browse files
committed
HTTP/3 Helm Chart - new variables, tests
1 parent 19d2bd8 commit 094b903

12 files changed

+218
-2
lines changed

charts/ingress-nginx/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,8 @@ metadata:
316316
| controller.configAnnotations | object | `{}` | Annotations to be added to the controller config configuration configmap. |
317317
| controller.configMapNamespace | string | `""` | Allows customization of the configmap / nginx-configmap namespace; defaults to $(POD_NAMESPACE) |
318318
| controller.containerName | string | `"controller"` | Configures the controller container name |
319-
| controller.containerPort | object | `{"http":80,"https":443}` | Configures the ports that the nginx-controller listens on |
319+
| controller.containerPort | object | `{"http":80,"https":443}` | Configures the TCP ports that the nginx-controller listens on |
320+
| controller.containerUdpPort | object | `{"quic":443}` | Configures the UDP ports that the nginx-controller listens on |
320321
| controller.containerSecurityContext | object | `{}` | Security context for controller containers |
321322
| controller.customTemplate.configMapKey | string | `""` | |
322323
| controller.customTemplate.configMapName | string | `""` | |
@@ -342,6 +343,7 @@ metadata:
342343
| controller.hostPort.enabled | bool | `false` | Enable 'hostPort' or not |
343344
| controller.hostPort.ports.http | int | `80` | 'hostPort' http port |
344345
| controller.hostPort.ports.https | int | `443` | 'hostPort' https port |
346+
| controller.hostPort.ports.quic | int | `443` | 'hostPort' quic port |
345347
| controller.hostname | object | `{}` | Optionally customize the pod hostname. |
346348
| controller.image.allowPrivilegeEscalation | bool | `false` | |
347349
| controller.image.chroot | bool | `false` | |
@@ -451,6 +453,7 @@ metadata:
451453
| controller.service.clusterIPs | list | `[]` | Pre-defined cluster internal IP addresses of the external controller service. Take care of collisions with existing services. This value is immutable. Set once, it can not be changed without deleting and re-creating the service. Ref: https://kubernetes.io/docs/concepts/services-networking/service/#choosing-your-own-ip-address |
452454
| controller.service.enableHttp | bool | `true` | Enable the HTTP listener on both controller services or not. |
453455
| controller.service.enableHttps | bool | `true` | Enable the HTTPS listener on both controller services or not. |
456+
| controller.service.enableQuic | bool | `false` | Enable the QUIC listener on both controller services or not. |
454457
| controller.service.enabled | bool | `true` | Enable controller services or not. This does not influence the creation of either the admission webhook or the metrics service. |
455458
| controller.service.external.enabled | bool | `true` | Enable the external controller service or not. Useful for internal-only deployments. |
456459
| controller.service.external.labels | object | `{}` | Labels to be added to the external controller service. |
@@ -471,6 +474,7 @@ metadata:
471474
| controller.service.internal.loadBalancerSourceRanges | list | `[]` | Restrict access to the internal controller service. Values must be CIDRs. Allows any source address by default. |
472475
| controller.service.internal.nodePorts.http | string | `""` | Node port allocated for the internal HTTP listener. If left empty, the service controller allocates one from the configured node port range. |
473476
| controller.service.internal.nodePorts.https | string | `""` | Node port allocated for the internal HTTPS listener. If left empty, the service controller allocates one from the configured node port range. |
477+
| controller.service.internal.nodePorts.quic | string | `""` | Node port allocated for the internal QUIC listener. If left empty, the service controller allocates one from the configured node port range. |
474478
| controller.service.internal.nodePorts.tcp | object | `{}` | Node port mapping for internal TCP listeners. If left empty, the service controller allocates them from the configured node port range. Example: tcp: 8080: 30080 |
475479
| controller.service.internal.nodePorts.udp | object | `{}` | Node port mapping for internal UDP listeners. If left empty, the service controller allocates them from the configured node port range. Example: udp: 53: 30053 |
476480
| controller.service.internal.ports | object | `{}` | |
@@ -486,6 +490,7 @@ metadata:
486490
| controller.service.loadBalancerSourceRanges | list | `[]` | Restrict access to the external controller service. Values must be CIDRs. Allows any source address by default. |
487491
| controller.service.nodePorts.http | string | `""` | Node port allocated for the external HTTP listener. If left empty, the service controller allocates one from the configured node port range. |
488492
| controller.service.nodePorts.https | string | `""` | Node port allocated for the external HTTPS listener. If left empty, the service controller allocates one from the configured node port range. |
493+
| controller.service.nodePorts.quic | string | `""` | Node port allocated for the external QUIC listener. If left empty, the service controller allocates one from the configured node port range. |
489494
| controller.service.nodePorts.tcp | object | `{}` | Node port mapping for external TCP listeners. If left empty, the service controller allocates them from the configured node port range. Example: tcp: 8080: 30080 |
490495
| controller.service.nodePorts.udp | object | `{}` | Node port mapping for external UDP listeners. If left empty, the service controller allocates them from the configured node port range. Example: udp: 53: 30053 |
491496
| controller.service.ports.http | int | `80` | Port the external HTTP listener is published with. |

charts/ingress-nginx/templates/controller-daemonset.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@ spec:
121121
hostPort: {{ index $.Values.controller.hostPort.ports $key | default $value }}
122122
{{- end }}
123123
{{- end }}
124+
{{- range $key, $value := .Values.controller.containerUdpPort }}
125+
- name: {{ $key }}
126+
containerPort: {{ $value }}
127+
protocol: UDP
128+
{{- if $.Values.controller.hostPort.enabled }}
129+
hostPort: {{ index $.Values.controller.hostPort.ports $key | default $value }}
130+
{{- end }}
131+
{{- end }}
124132
{{- if .Values.controller.metrics.enabled }}
125133
- name: {{ .Values.controller.metrics.portName }}
126134
containerPort: {{ .Values.controller.metrics.port }}

charts/ingress-nginx/templates/controller-deployment.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,14 @@ spec:
127127
hostPort: {{ index $.Values.controller.hostPort.ports $key | default $value }}
128128
{{- end }}
129129
{{- end }}
130+
{{- range $key, $value := .Values.controller.containerUdpPort }}
131+
- name: {{ $key }}
132+
containerPort: {{ $value }}
133+
protocol: UDP
134+
{{- if $.Values.controller.hostPort.enabled }}
135+
hostPort: {{ index $.Values.controller.hostPort.ports $key | default $value }}
136+
{{- end }}
137+
{{- end }}
130138
{{- if .Values.controller.metrics.enabled }}
131139
- name: {{ .Values.controller.metrics.portName }}
132140
containerPort: {{ .Values.controller.metrics.port }}

charts/ingress-nginx/templates/controller-networkpolicy.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ spec:
2424
- protocol: TCP
2525
port: {{ $value }}
2626
{{- end }}
27+
{{- range $key, $value := .Values.controller.containerUdpPort }}
28+
- protocol: UDP
29+
port: {{ $value }}
30+
{{- end }}
2731
{{- if .Values.controller.metrics.enabled }}
2832
- protocol: TCP
2933
port: {{ .Values.controller.metrics.port }}

charts/ingress-nginx/templates/controller-service-internal.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,18 @@ spec:
8888
nodePort: {{ .Values.controller.service.internal.nodePorts.https }}
8989
{{- end }}
9090
{{- end }}
91+
{{- if .Values.controller.service.enableQuic }}
92+
- name: quic
93+
port: {{ .Values.controller.service.internal.ports.quic | default .Values.controller.service.ports.quic }}
94+
protocol: UDP
95+
targetPort: {{ .Values.controller.service.internal.targetPorts.quic | default .Values.controller.service.targetPorts.quic }}
96+
{{- if and (semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version) (.Values.controller.service.internal.appProtocol) }}
97+
appProtocol: https
98+
{{- end }}
99+
{{- if (and $setNodePorts (not (empty .Values.controller.service.internal.nodePorts.quic))) }}
100+
nodePort: {{ .Values.controller.service.internal.nodePorts.quic }}
101+
{{- end }}
102+
{{- end }}
91103
{{- range $key, $value := .Values.tcp }}
92104
- name: {{ if $.Values.portNamePrefix }}{{ $.Values.portNamePrefix }}-{{ end }}{{ $key }}-tcp
93105
port: {{ $key }}

charts/ingress-nginx/templates/controller-service.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,18 @@ spec:
8888
nodePort: {{ .Values.controller.service.nodePorts.https }}
8989
{{- end }}
9090
{{- end }}
91+
{{- if .Values.controller.service.enableQuic }}
92+
- name: quic
93+
port: {{ .Values.controller.service.ports.quic }}
94+
protocol: UDP
95+
targetPort: {{ .Values.controller.service.targetPorts.quic }}
96+
{{- if and (semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version) (.Values.controller.service.appProtocol) }}
97+
appProtocol: https
98+
{{- end }}
99+
{{- if (and $setNodePorts (not (empty .Values.controller.service.nodePorts.quic))) }}
100+
nodePort: {{ .Values.controller.service.nodePorts.quic }}
101+
{{- end }}
102+
{{- end }}
91103
{{- range $key, $value := .Values.tcp }}
92104
- name: {{ if $.Values.portNamePrefix }}{{ $.Values.portNamePrefix }}-{{ end }}{{ $key }}-tcp
93105
port: {{ $key }}

charts/ingress-nginx/tests/controller-daemonset_test.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,26 @@ tests:
208208
- equal:
209209
path: spec.template.spec.runtimeClassName
210210
value: myClass
211+
212+
- it: should create a DaemonSet with a default UDP container port
213+
set:
214+
controller.kind: DaemonSet
215+
asserts:
216+
- contains:
217+
path: spec.template.spec.containers[0].ports
218+
content:
219+
name: quic
220+
containerPort: 443
221+
protocol: UDP
222+
223+
- it: should create a DaemonSet with a custom UDP container port if `controller.containerUdpPort.quic` is set
224+
set:
225+
controller.kind: DaemonSet
226+
controller.containerUdpPort.quic: 1234
227+
asserts:
228+
- contains:
229+
path: spec.template.spec.containers[0].ports
230+
content:
231+
name: quic
232+
containerPort: 1234
233+
protocol: UDP

charts/ingress-nginx/tests/controller-deployment_test.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,3 +231,23 @@ tests:
231231
- equal:
232232
path: spec.template.spec.runtimeClassName
233233
value: myClass
234+
235+
- it: should create a Deployment with a default UDP container port
236+
asserts:
237+
- contains:
238+
path: spec.template.spec.containers[0].ports
239+
content:
240+
name: quic
241+
containerPort: 443
242+
protocol: UDP
243+
244+
- it: should create a Deployment with a custom UDP container port if `controller.containerUdpPort.quic` is set
245+
set:
246+
controller.containerUdpPort.quic: 1234
247+
asserts:
248+
- contains:
249+
path: spec.template.spec.containers[0].ports
250+
content:
251+
name: quic
252+
containerPort: 1234
253+
protocol: UDP

charts/ingress-nginx/tests/controller-networkpolicy_test.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,24 @@ tests:
2121
- equal:
2222
path: metadata.name
2323
value: RELEASE-NAME-ingress-nginx-controller
24+
25+
- it: should create a NetworkPolicy with a default UDP port
26+
set:
27+
controller.networkPolicy.enabled: true
28+
asserts:
29+
- contains:
30+
path: spec.ingress[0].ports
31+
content:
32+
protocol: UDP
33+
port: 443
34+
35+
- it: should create a NetworkPolicy with a custom UDP port if `controller.containerUdpPort.quic` is set
36+
set:
37+
controller.networkPolicy.enabled: true
38+
controller.containerUdpPort.quic: 1234
39+
asserts:
40+
- contains:
41+
path: spec.ingress[0].ports
42+
content:
43+
protocol: UDP
44+
port: 1234

charts/ingress-nginx/tests/controller-service-internal_test.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,57 @@ tests:
7373
- equal:
7474
path: metadata.labels["external-dns.alpha.kubernetes.io/hostname"]
7575
value: internal.example.com
76+
77+
- it: should create a Service with a default UDP port if `controller.service.enableQuic` is set
78+
set:
79+
controller.service.internal.enabled: true
80+
controller.service.internal.annotations:
81+
test.annotation: "true"
82+
controller.service.enableQuic: true
83+
asserts:
84+
- contains:
85+
path: spec.ports
86+
content:
87+
name: quic
88+
port: 443
89+
protocol: UDP
90+
targetPort: quic
91+
appProtocol: https
92+
93+
- it: should create a Service with a custom internal UDP port if `controller.service.enableQuic` is set
94+
set:
95+
controller.service.internal.enabled: true
96+
controller.service.internal.annotations:
97+
test.annotation: "true"
98+
controller.service.enableQuic: true
99+
controller.service.ports.quic: 1234
100+
controller.service.targetPorts.quic: 5678
101+
controller.service.internal.ports.quic: 4321
102+
controller.service.internal.targetPorts.quic: 8765
103+
asserts:
104+
- contains:
105+
path: spec.ports
106+
content:
107+
name: quic
108+
port: 4321
109+
protocol: UDP
110+
targetPort: 8765
111+
appProtocol: https
112+
113+
- it: should create a Service with a custom service UDP port if `controller.service.enableQuic` is set
114+
set:
115+
controller.service.internal.enabled: true
116+
controller.service.internal.annotations:
117+
test.annotation: "true"
118+
controller.service.enableQuic: true
119+
controller.service.ports.quic: 1234
120+
controller.service.targetPorts.quic: 5678
121+
asserts:
122+
- contains:
123+
path: spec.ports
124+
content:
125+
name: quic
126+
port: 1234
127+
protocol: UDP
128+
targetPort: 5678
129+
appProtocol: https

0 commit comments

Comments
 (0)