diff --git a/traefik/templates/_service.tpl b/traefik/templates/_service.tpl index e82c9a099..e7b58921e 100644 --- a/traefik/templates/_service.tpl +++ b/traefik/templates/_service.tpl @@ -46,6 +46,9 @@ {{- if $config.nodePort }} nodePort: {{ $config.nodePort }} {{- end }} + {{- if $config.appProtocol }} + appProtocol: {{ $config.appProtocol }} + {{- end }} {{- end }} {{- if $config.http3 }} {{- if $config.http3.enabled }} @@ -57,6 +60,9 @@ {{- if $config.nodePort }} nodePort: {{ $config.nodePort }} {{- end }} + {{- if $config.appProtocol }} + appProtocol: {{ $config.appProtocol }} + {{- end }} {{- end }} {{- end }} {{- end }} diff --git a/traefik/tests/service-config_test.yaml b/traefik/tests/service-config_test.yaml index a05f8fbb8..ca2f976ae 100644 --- a/traefik/tests/service-config_test.yaml +++ b/traefik/tests/service-config_test.yaml @@ -177,6 +177,28 @@ tests: value: - IPv6 documentIndex: 0 + - it: should not have appProtocol when not specified + documentIndex: 0 + asserts: + - isNull: + path: spec.ports[0].appProtocol + - isNull: + path: spec.ports[1].appProtocol + - it: should have custom appProtocol when specified via values + set: + ports: + web: + appProtocol: http + websecure: + appProtocol: https + documentIndex: 0 + asserts: + - equal: + path: spec.ports[0].appProtocol + value: http + - equal: + path: spec.ports[1].appProtocol + value: https - it: should use default websecure UDP port when http3 is enabled set: ports: diff --git a/traefik/values.yaml b/traefik/values.yaml index abd5da011..345bbd8be 100644 --- a/traefik/values.yaml +++ b/traefik/values.yaml @@ -612,6 +612,8 @@ ports: ## -- The port protocol (TCP/UDP) protocol: TCP # nodePort: 32443 + ## -- Specify an application protocol. This may be used as a hint for a Layer 7 load balancer. + # appProtocol: https # ## -- Enable HTTP/3 on the entrypoint ## Enabling it will also enable http3 experimental feature