Skip to content

Commit 7c5fd8c

Browse files
authored
Merge pull request #31 from emsearcy/support-existing-traefik
Allow external traefik
2 parents 4f1d8b6 + 016bd9a commit 7c5fd8c

File tree

6 files changed

+53
-24
lines changed

6 files changed

+53
-24
lines changed

charts/lfx-platform/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apiVersion: v2
55
name: lfx-platform
66
description: LFX Platform v2 Helm chart
77
type: application
8-
version: 0.1.11
8+
version: 0.1.12
99
icon: https://github.com/linuxfoundation/lfx-v2-helm/raw/main/img/lfx-logo-color.svg
1010
dependencies:
1111
- name: traefik

charts/lfx-platform/templates/heimdall/middleware.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Copyright The Linux Foundation and each contributor to LFX.
22
# SPDX-License-Identifier: MIT
33
---
4-
{{ if and .Values.heimdall.enabled .Values.traefik.enabled -}}
4+
{{ if and .Values.heimdall.enabled (or
5+
.Values.traefik.enabled .Values.lfx.parentGateway.enabled) -}}
56
apiVersion: traefik.io/v1alpha1
67
kind: Middleware
78
metadata:

charts/lfx-platform/templates/mailpit/httproute.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
# Copyright The Linux Foundation and each contributor to LFX.
22
# SPDX-License-Identifier: MIT
33
---
4-
{{ if and .Values.mailpit.enabled .Values.traefik.enabled -}}
4+
{{ if and .Values.mailpit.enabled (or
5+
.Values.traefik.enabled .Values.lfx.parentGateway.enabled) -}}
56
apiVersion: gateway.networking.k8s.io/v1
67
kind: HTTPRoute
78
metadata:
89
name: {{ include "common.names.fullname" .Subcharts.mailpit }}
910
namespace: {{ .Release.Namespace }}
1011
spec:
1112
parentRefs:
13+
{{- if .Values.traefik.enabled }}
1214
- name: {{ .Values.traefik.gateway.name }}
1315
sectionName: {{ include "lfx-platform.default-listener" . }}
1416
namespace: {{ .Release.Namespace }}
17+
{{- else }}
18+
- name: {{ .Values.lfx.parentGateway.name }}
19+
sectionName: {{ .Values.lfx.parentGateway.sectionName }}
20+
namespace: {{ .Values.lfx.parentGateway.namespace }}
21+
{{- end }}
1522
hostnames:
1623
- 'mailpit.{{ .Values.lfx.domain }}'
1724
rules:

charts/lfx-platform/templates/mailpit/https-redirect-httproute.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
# Copyright The Linux Foundation and each contributor to LFX.
22
# SPDX-License-Identifier: MIT
33
---
4-
{{ if and .Values.mailpit.enabled .Values.traefik.enabled (include "lfx-platform.https-enabled" .) -}}
4+
{{ if and .Values.mailpit.enabled (include "lfx-platform.https-enabled" .) (or
5+
.Values.traefik.enabled .Values.lfx.parentGateway.enabled) -}}
56
apiVersion: gateway.networking.k8s.io/v1
67
kind: HTTPRoute
78
metadata:
89
name: mailpit-https-redirect
910
namespace: {{ .Release.Namespace }}
1011
spec:
1112
parentRefs:
13+
{{- if .Values.traefik.enabled }}
1214
- name: {{ .Values.traefik.gateway.name }}
1315
sectionName: {{ include "lfx-platform.http-listener" . }}
1416
namespace: {{ .Release.Namespace }}
17+
{{- else }}
18+
- name: {{ .Values.lfx.parentGateway.name }}
19+
sectionName: {{ .Values.lfx.parentGateway.sectionName }}
20+
namespace: {{ .Values.lfx.parentGateway.namespace }}
21+
{{- end }}
1522
hostnames:
1623
- 'mailpit.{{ .Values.lfx.domain }}'
1724
rules:
Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,41 @@
11
# Copyright The Linux Foundation and each contributor to LFX.
22
# SPDX-License-Identifier: MIT
33
---
4-
{{- if and .Values.lfx.whoami.enabled .Values.traefik.enabled }}
4+
{{- if and .Values.lfx.whoami.enabled (or
5+
.Values.traefik.enabled .Values.lfx.parentGateway.enabled) }}
56
apiVersion: gateway.networking.k8s.io/v1
67
kind: HTTPRoute
78
metadata:
89
name: whoami
910
namespace: {{ .Release.Namespace }}
1011
spec:
1112
parentRefs:
12-
- name: {{ .Values.traefik.gateway.name }}
13-
namespace: {{ .Release.Namespace }}
13+
{{- if .Values.traefik.enabled }}
14+
- name: {{ .Values.traefik.gateway.name }}
15+
sectionName: {{ include "lfx-platform.default-listener" . }}
16+
namespace: {{ .Release.Namespace }}
17+
{{- else }}
18+
- name: {{ .Values.lfx.parentGateway.name }}
19+
sectionName: {{ .Values.lfx.parentGateway.sectionName }}
20+
namespace: {{ .Values.lfx.parentGateway.namespace }}
21+
{{- end }}
1422
hostnames:
15-
- "lfx-api.{{ .Values.lfx.domain }}"
23+
- "lfx-api.{{ .Values.lfx.domain }}"
1624
rules:
17-
# Main application endpoints (with authentication)
18-
- matches:
19-
- path:
20-
type: Exact
21-
value: /whoami
22-
{{- if .Values.heimdall.enabled }}
23-
filters:
24-
- type: ExtensionRef
25-
extensionRef:
26-
group: traefik.io
27-
kind: Middleware
28-
name: heimdall
29-
{{- end }}
30-
backendRefs:
31-
- name: whoami
32-
port: 80
25+
# Main application endpoints (with authentication)
26+
- matches:
27+
- path:
28+
type: Exact
29+
value: /whoami
30+
{{- if .Values.heimdall.enabled }}
31+
filters:
32+
- type: ExtensionRef
33+
extensionRef:
34+
group: traefik.io
35+
kind: Middleware
36+
name: heimdall
37+
{{- end }}
38+
backendRefs:
39+
- name: whoami
40+
port: 80
3341
{{- end }}

charts/lfx-platform/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ lfx:
2323
# local dev with authelia
2424
use_oidc_contextualizer: true
2525

26+
# Fallback gateway can be enabled if traefik.enabled is false.
27+
parentGateway:
28+
enabled: false
29+
name: traefik
30+
sectionName: websecure
31+
namespace: default
2632

2733
fga-operator:
2834
enabled: true

0 commit comments

Comments
 (0)