Skip to content

Commit f4426fa

Browse files
committed
[ADD] Add traefik support
1 parent 135b974 commit f4426fa

File tree

4 files changed

+33
-2
lines changed

4 files changed

+33
-2
lines changed

deploy/kubernetes/charts/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.1.2
18+
version: 0.2.1
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

deploy/kubernetes/charts/templates/ingress.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if .Values.ingress.enabled }}
1+
{{- if and .Values.ingress.enabled (not .Values.ingress.traefik.enabled) }}
22
apiVersion: networking.k8s.io/v1
33
kind: Ingress
44
metadata:
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{{- if .Values.ingress.traefik.enabled }}
2+
apiVersion: traefik.io/v1alpha1
3+
kind: IngressRoute
4+
metadata:
5+
name: {{ .Values.ingress.name }}
6+
{{- with .Values.ingress.customAnnotations }}
7+
annotations:
8+
{{- range $k, $v := . }}
9+
{{- if not (hasPrefix "nginx.ingress.kubernetes.io" $k) }}
10+
{{ $k }}: {{ $v }}
11+
{{- end }}
12+
{{- end }}
13+
{{- end }}
14+
spec:
15+
entryPoints:
16+
- {{ .Values.ingress.traefik.entryPoint | default "web" }}
17+
routes:
18+
{{- range $host := .Values.ingress.hosts }}
19+
{{- range $path := $host.paths }}
20+
- kind: Rule
21+
match: >
22+
Host(`{{ $host.host }}`) && PathPrefix(`{{ $path.path }}`)
23+
services:
24+
- name: {{ if hasKey $path "serviceName" }}{{ $path.serviceName }}{{ else if hasKey $.Values.irisapp "name" }}{{ $.Values.irisapp.name }}{{ else }}{{ fail "Missing 'serviceName'" }}{{ end }}
25+
port: {{ if hasKey $path "servicePort" }}{{ $path.servicePort }}{{ else if hasKey $.Values.irisapp.service "port" }}{{ $.Values.irisapp.service.port }}{{ else }}{{ fail "Missing 'servicePort'" }}{{ end }}
26+
{{- end }}
27+
{{- end }}
28+
{{- end }}

deploy/kubernetes/charts/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@ ingress:
224224
enabled: true
225225
name: iris-ingress
226226
className: nginx
227+
traefik:
228+
enabled: false
229+
entryPoint: web
227230
enableTls: false
228231
sslRedirect: false
229232
customAnnotations:

0 commit comments

Comments
 (0)