Skip to content

Commit 31fafcb

Browse files
committed
HTTP/3 support
1 parent a031a08 commit 31fafcb

File tree

30 files changed

+585
-20
lines changed

30 files changed

+585
-20
lines changed

build/kind.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ nodes:
1616
- containerPort: 443
1717
hostPort: 443
1818
protocol: TCP
19+
- containerPort: 443
20+
hostPort: 443
21+
protocol: UDP

charts/ingress-nginx/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,9 @@ metadata:
320320
| controller.configAnnotations | object | `{}` | Annotations to be added to the controller config configuration configmap. |
321321
| controller.configMapNamespace | string | `""` | Allows customization of the configmap / nginx-configmap namespace; defaults to $(POD_NAMESPACE) |
322322
| controller.containerName | string | `"controller"` | Configures the controller container name |
323-
| controller.containerPort | object | `{"http":80,"https":443}` | Configures the ports that the nginx-controller listens on |
323+
| controller.containerPort | object | `{"http":80,"https":443}` | Configures the TCP ports that the nginx-controller listens on |
324324
| controller.containerSecurityContext | object | `{}` | Security context for controller containers |
325+
| controller.containerUdpPort | object | `{}` | Configures the UDP ports that the nginx-controller listens on |
325326
| controller.customTemplate.configMapKey | string | `""` | |
326327
| controller.customTemplate.configMapName | string | `""` | |
327328
| controller.disableLeaderElection | bool | `false` | This configuration disable Nginx Controller Leader Election |
@@ -346,6 +347,7 @@ metadata:
346347
| controller.hostPort.enabled | bool | `false` | Enable 'hostPort' or not |
347348
| controller.hostPort.ports.http | int | `80` | 'hostPort' http port |
348349
| controller.hostPort.ports.https | int | `443` | 'hostPort' https port |
350+
| controller.hostPort.ports.quic | int | `443` | 'hostPort' quic port |
349351
| controller.hostname | object | `{}` | Optionally customize the pod hostname. |
350352
| controller.image.allowPrivilegeEscalation | bool | `false` | |
351353
| controller.image.chroot | bool | `false` | |
@@ -456,6 +458,7 @@ metadata:
456458
| 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 |
457459
| controller.service.enableHttp | bool | `true` | Enable the HTTP listener on both controller services or not. |
458460
| controller.service.enableHttps | bool | `true` | Enable the HTTPS listener on both controller services or not. |
461+
| controller.service.enableQuic | bool | `false` | Enable the QUIC listener on both controller services or not. |
459462
| 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. |
460463
| controller.service.external.enabled | bool | `true` | Enable the external controller service or not. Useful for internal-only deployments. |
461464
| controller.service.external.labels | object | `{}` | Labels to be added to the external controller service. |
@@ -476,6 +479,7 @@ metadata:
476479
| controller.service.internal.loadBalancerSourceRanges | list | `[]` | Restrict access to the internal controller service. Values must be CIDRs. Allows any source address by default. |
477480
| 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. |
478481
| 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. |
482+
| 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. |
479483
| 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 |
480484
| 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 |
481485
| controller.service.internal.ports | object | `{}` | |
@@ -491,13 +495,16 @@ metadata:
491495
| controller.service.loadBalancerSourceRanges | list | `[]` | Restrict access to the external controller service. Values must be CIDRs. Allows any source address by default. |
492496
| 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. |
493497
| 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. |
498+
| 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. |
494499
| 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 |
495500
| 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 |
496501
| controller.service.ports.http | int | `80` | Port the external HTTP listener is published with. |
497502
| controller.service.ports.https | int | `443` | Port the external HTTPS listener is published with. |
503+
| controller.service.ports.quic | int | `443` | Port the external QUIC listener is published with. |
498504
| controller.service.sessionAffinity | string | `""` | Session affinity of the external controller service. Must be either "None" or "ClientIP" if set. Defaults to "None". Ref: https://kubernetes.io/docs/reference/networking/virtual-ips/#session-affinity |
499505
| controller.service.targetPorts.http | string | `"http"` | Port of the ingress controller the external HTTP listener is mapped to. |
500506
| controller.service.targetPorts.https | string | `"https"` | Port of the ingress controller the external HTTPS listener is mapped to. |
507+
| controller.service.targetPorts.quic | string | `"quic"` | Port of the ingress controller the external QUIC listener is mapped to. |
501508
| controller.service.trafficDistribution | string | `""` | Traffic distribution policy of the external controller service. Set to "PreferClose" to route traffic to endpoints that are topologically closer to the client. Ref: https://kubernetes.io/docs/concepts/services-networking/service/#traffic-distribution |
502509
| controller.service.type | string | `"LoadBalancer"` | Type of the external controller service. Ref: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types |
503510
| controller.shareProcessNamespace | bool | `false` | |

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: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,15 @@ tests:
228228
restartPolicy: NotRequired
229229
- resourceName: memory
230230
restartPolicy: RestartContainer
231+
232+
- it: should create a DaemonSet with a custom UDP container port if `controller.containerUdpPort.quic` is set
233+
set:
234+
controller.kind: DaemonSet
235+
controller.containerUdpPort.quic: 1234
236+
asserts:
237+
- contains:
238+
path: spec.template.spec.containers[0].ports
239+
content:
240+
name: quic
241+
containerPort: 1234
242+
protocol: UDP

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,3 +250,14 @@ tests:
250250
restartPolicy: NotRequired
251251
- resourceName: memory
252252
restartPolicy: RestartContainer
253+
254+
- it: should create a Deployment with a custom UDP container port if `controller.containerUdpPort.quic` is set
255+
set:
256+
controller.containerUdpPort.quic: 1234
257+
asserts:
258+
- contains:
259+
path: spec.template.spec.containers[0].ports
260+
content:
261+
name: quic
262+
containerPort: 1234
263+
protocol: UDP

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

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

0 commit comments

Comments
 (0)