Skip to content

Commit

Permalink
fix: 🐛 http3 with internal service
Browse files Browse the repository at this point in the history
  • Loading branch information
mloiseleur authored Oct 29, 2024
1 parent 74abfee commit 7558e63
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
5 changes: 4 additions & 1 deletion traefik/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ spec:
{{- end }}

{{- if and $exposedPorts (and $udpPorts (not $service.single)) }}
{{- $ports := include "traefik.service-ports" (dict "ports" $udpPorts "serviceName" $name) }}
{{- if not (empty $ports) }}
---
apiVersion: v1
kind: Service
Expand All @@ -76,7 +78,8 @@ metadata:
spec:
{{- template "traefik.service-spec" (dict "root" $ "service" $service) }}
ports:
{{- template "traefik.service-ports" (dict "ports" $udpPorts "serviceName" $name) }}
{{- $ports }}
{{- end }}
{{- end }}

{{- end -}}
Expand Down
32 changes: 32 additions & 0 deletions traefik/tests/service-config-custom_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,35 @@ tests:
protocol: UDP
targetPort: websecure-http3
documentIndex: 1
- it: should not provide udp Service when exposing traefik port on internal service with http3 on websecure
set:
ports:
web:
expose:
internal: false
websecure:
http3:
enabled: true
traefik:
expose:
internal: true
service:
additionalServices:
internal: {}
asserts:
- hasDocuments:
count: 2
- equal:
path: metadata.namespace
value: NAMESPACE
- containsDocument:
kind: Service
apiVersion: v1
name: RELEASE-NAME-traefik
documentIndex: 0
- containsDocument:
kind: Service
apiVersion: v1
name: RELEASE-NAME-traefik-internal
documentIndex: 1

6 changes: 6 additions & 0 deletions traefik/tests/service-config-multiple_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ tests:
udp:
port: 3000
protocol: UDP
expose:
default: true
asserts:
- isNull:
path: spec.ipFamilyPolicy
Expand All @@ -171,6 +173,8 @@ tests:
udp:
port: 3000
protocol: UDP
expose:
default: true
asserts:
- equal:
path: spec.ipFamilyPolicy
Expand All @@ -188,6 +192,8 @@ tests:
udp:
port: 3000
protocol: UDP
expose:
default: true
asserts:
- isNull:
path: spec.ipFamilies
Expand Down

0 comments on commit 7558e63

Please sign in to comment.