Skip to content

Commit

Permalink
Allow setting TLS options on dashboard IngressRoute
Browse files Browse the repository at this point in the history
  • Loading branch information
jnoordsij authored and terrych0u committed Oct 2, 2023
1 parent f77c771 commit 18f4056
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
9 changes: 6 additions & 3 deletions traefik/templates/dashboard-ingressroute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ spec:
services:
- name: api@internal
kind: TraefikService
{{- if .Values.ingressRoute.dashboard.middlewares }}
{{- with .Values.ingressRoute.dashboard.middlewares }}
middlewares:
{{- with .Values.ingressRoute.dashboard.middlewares }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- end -}}

{{- with .Values.ingressRoute.dashboard.tls }}
tls:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end -}}
27 changes: 26 additions & 1 deletion traefik/tests/dashboard-ingressroute_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ tests:
set:
ingressRoute:
dashboard:
entryPoints: ["websecure"]
entryPoints: ["websecure"]
asserts:
- equal:
path: spec.entryPoints
Expand All @@ -48,6 +48,10 @@ tests:
- equal:
path: metadata.labels.foo
value: bar
- it: should not have middlewares by default
asserts:
- isEmpty:
path: spec.routes[0].middlewares
- it: should support adding middlewares
set:
ingressRoute:
Expand All @@ -61,3 +65,24 @@ tests:
value:
- name: traefik-dashboard-auth
namespace: default
- it: should not have tls options by default
asserts:
- isEmpty:
path: spec.tls
- it: should support adding tls options
set:
ingressRoute:
dashboard:
tls:
secretName: traefik-dashboard-auth
options:
name: tls-options
namespace: default
asserts:
- equal:
path: spec.tls
value:
secretName: traefik-dashboard-auth
options:
name: tls-options
namespace: default
2 changes: 2 additions & 0 deletions traefik/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ ingressRoute:
entryPoints: ["traefik"]
# Additional ingressRoute middlewares (e.g. for authentication)
middlewares: []
# TLS options (e.g. secret containing certificate)
tls: {}

# Customize updateStrategy of traefik pods
updateStrategy:
Expand Down

0 comments on commit 18f4056

Please sign in to comment.