-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2fcbf0f
commit 084b473
Showing
3 changed files
with
163 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{{- if .Values.ingressRoute.dashboard.enabled -}} | ||
apiVersion: traefik.io/v1alpha1 | ||
kind: IngressRoute | ||
metadata: | ||
name: {{ .Values.cluster }}-dashboard | ||
namespace: {{ $.Release.Namespace }} | ||
annotations: | ||
{{- with .Values.ingressRoute.dashboard.annotations }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
labels: | ||
{{- include "common.labels" . | nindent 4 }} | ||
{{- with .Values.ingressRoute.dashboard.labels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
entryPoints: | ||
{{- range .Values.ingressRoute.dashboard.entryPoints }} | ||
- {{ . }} | ||
{{- end }} | ||
routes: | ||
- match: {{ .Values.ingressRoute.dashboard.matchRule }} | ||
kind: Rule | ||
services: | ||
- name: api@internal | ||
kind: TraefikService | ||
{{- with .Values.ingressRoute.dashboard.middlewares }} | ||
middlewares: | ||
{{- toYaml . | nindent 6 }} | ||
{{- end -}} | ||
|
||
{{- with .Values.ingressRoute.dashboard.tls }} | ||
tls: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
suite: Dashboard IngressRoute configuration | ||
templates: | ||
- dashboard-ingressroute.yaml | ||
tests: | ||
- it: should be disabled by default | ||
asserts: | ||
- hasDocuments: | ||
count: 0 | ||
- it: should have the expected default route match rule | ||
set: | ||
ingressRoute: | ||
dashboard: | ||
enabled: true | ||
asserts: | ||
- equal: | ||
path: spec.routes[0].match | ||
value: PathPrefix(`/dashboard`) || PathPrefix(`/api`) | ||
- it: should support overwriting the route match rule | ||
set: | ||
ingressRoute: | ||
dashboard: | ||
enabled: true | ||
matchRule: Host(`traefik.example.com`) | ||
asserts: | ||
- equal: | ||
path: spec.routes[0].match | ||
value: Host(`traefik.example.com`) | ||
- it: should have traefik as default entryPoints | ||
set: | ||
ingressRoute: | ||
dashboard: | ||
enabled: true | ||
asserts: | ||
- equal: | ||
path: spec.entryPoints | ||
value: ["traefik"] | ||
- it: should support setting websecure as entryPoint | ||
set: | ||
ingressRoute: | ||
dashboard: | ||
enabled: true | ||
entryPoints: ["websecure"] | ||
asserts: | ||
- equal: | ||
path: spec.entryPoints | ||
value: ["websecure"] | ||
- it: should support adding specific label on IngressRoute | ||
set: | ||
ingressRoute: | ||
dashboard: | ||
enabled: true | ||
labels: | ||
foo: bar | ||
asserts: | ||
- equal: | ||
path: metadata.labels.foo | ||
value: bar | ||
- it: should not have middlewares by default | ||
set: | ||
ingressRoute: | ||
dashboard: | ||
enabled: true | ||
asserts: | ||
- isNull: | ||
path: spec.routes[0].middlewares | ||
- it: should support adding middlewares | ||
set: | ||
ingressRoute: | ||
dashboard: | ||
enabled: true | ||
middlewares: | ||
- name: traefik-dashboard-auth | ||
namespace: default | ||
asserts: | ||
- equal: | ||
path: spec.routes[0].middlewares | ||
value: | ||
- name: traefik-dashboard-auth | ||
namespace: default | ||
- it: should not have tls options by default | ||
set: | ||
ingressRoute: | ||
dashboard: | ||
enabled: true | ||
asserts: | ||
- isNull: | ||
path: spec.tls | ||
- it: should support adding tls options | ||
set: | ||
ingressRoute: | ||
dashboard: | ||
enabled: true | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters