Skip to content

Commit 7fec1e1

Browse files
Add optional 2nd ingress to allow splitting traffic for public & VPN (#2)
Co-authored-by: Tobias McNulty <tobiasmcnulty@users.noreply.github.com>
1 parent 441f6d3 commit 7fec1e1

File tree

4 files changed

+103
-1
lines changed

4 files changed

+103
-1
lines changed

charts/odk-central/CHANGELOG.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Changelog
2+
3+
This file documents all notable changes to the ODK Central Helm Chart.
4+
The release numbering uses [semantic versioning](http://semver.org).
5+
6+
## 0.3.0
7+
8+
- Add optional 2nd ingress to allow splitting traffic for public & VPN (#2)
9+
10+
## 0.2.0
11+
12+
- Update redis-ha subchart and enable haproxy (76abe4a48d3eecf0c76c5ad060235cf15a049497)
13+
14+
## 0.1.3
15+
16+
- Fix `ENKETO_URL` and `DOMAIN` environment variables (dc8a34f4aa46a5d3be448385360042bea4216052)
17+
18+
## 0.1.2
19+
20+
- Fix missing Enketo secrets (d2c8a86499f5ab6d234abd8be6c24e545ed96c0c)
21+
22+
## 0.1.1
23+
24+
- Build chart dependencies in CI (3c181959ad18513e9dd7d9f29366d960f67682cb)
25+
- Remove extraneous template files (3a164ff69dc38797fdfb1e29ab408f25a3fdddb0)
26+
27+
## 0.1.0
28+
29+
- Initial release (#1)

charts/odk-central/Chart.yaml

+1-1
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.2.0
18+
version: 0.3.0
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

charts/odk-central/charts/backend/values.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,18 @@ service:
4848
type: ClusterIP
4949
port: 8383
5050

51+
ingressApp:
52+
enabled: false
53+
className: ""
54+
annotations: {}
55+
# kubernetes.io/ingress.class: nginx
56+
# kubernetes.io/tls-acme: "true"
57+
hosts:
58+
- host: chart-example.local
59+
paths:
60+
- path: /
61+
pathType: ImplementationSpecific
62+
5163
ingress:
5264
enabled: false
5365
className: ""
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{{- if .Values.ingressApp.enabled -}}
2+
{{- $fullName := include "frontend.fullname" . -}}
3+
{{- $svcPort := .Values.service.port -}}
4+
{{- if and .Values.ingressApp.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
5+
{{- if not (hasKey .Values.ingressApp.annotations "kubernetes.io/ingress.class") }}
6+
{{- $_ := set .Values.ingressApp.annotations "kubernetes.io/ingress.class" .Values.ingressApp.className}}
7+
{{- end }}
8+
{{- end }}
9+
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
10+
apiVersion: networking.k8s.io/v1
11+
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
12+
apiVersion: networking.k8s.io/v1beta1
13+
{{- else -}}
14+
apiVersion: extensions/v1beta1
15+
{{- end }}
16+
kind: Ingress
17+
metadata:
18+
name: {{ $fullName }}-app
19+
labels:
20+
{{- include "frontend.labels" . | nindent 4 }}
21+
{{- with .Values.ingressApp.annotations }}
22+
annotations:
23+
{{- toYaml . | nindent 4 }}
24+
{{- end }}
25+
spec:
26+
{{- if and .Values.ingressApp.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
27+
ingressClassName: {{ .Values.ingressApp.className }}
28+
{{- end }}
29+
{{- if .Values.ingressApp.tls }}
30+
tls:
31+
{{- range .Values.ingressApp.tls }}
32+
- hosts:
33+
{{- range .hosts }}
34+
- {{ . | quote }}
35+
{{- end }}
36+
secretName: {{ .secretName }}
37+
{{- end }}
38+
{{- end }}
39+
rules:
40+
{{- range .Values.ingressApp.hosts }}
41+
- host: {{ .host | quote }}
42+
http:
43+
paths:
44+
{{- range .paths }}
45+
- path: {{ .path }}
46+
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
47+
pathType: {{ .pathType }}
48+
{{- end }}
49+
backend:
50+
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
51+
service:
52+
name: {{ $fullName }}
53+
port:
54+
number: {{ $svcPort }}
55+
{{- else }}
56+
serviceName: {{ $fullName }}
57+
servicePort: {{ $svcPort }}
58+
{{- end }}
59+
{{- end }}
60+
{{- end }}
61+
{{- end }}

0 commit comments

Comments
 (0)