Skip to content

Commit b47cd67

Browse files
Improve helm chart (#1144)
* [helm] Allow to disable ingress Signed-off-by: Wilfried Roset <wilfriedroset@users.noreply.github.com> * [helm] Allow to define the ingress className Signed-off-by: Wilfried Roset <wilfriedroset@users.noreply.github.com> * [helm] Allow to define the tls block of the ingress Signed-off-by: Wilfried Roset <wilfriedroset@users.noreply.github.com> * [helm] Allow to pass extraEnv and extraEnvFrom to deployment The chart relies on [external-secrets.io](https://external-secrets.io) to pull the secrets. This might not be convenient for open source community users. As such, let's complete the externalSecrets with `env` and `envFrom` via respectively `.Values.extraEnv` and `.Values.extraEnvFrom`. Signed-off-by: Wilfried Roset <wilfriedroset@users.noreply.github.com> --------- Signed-off-by: Wilfried Roset <wilfriedroset@users.noreply.github.com>
1 parent 1cfde5b commit b47cd67

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

chart/templates/deployment.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,20 @@ spec:
5151
protocol: TCP
5252
{{- end }}
5353
resources: {{ toYaml .Values.resources | nindent 12 }}
54+
{{- with $.Values.extraEnv }}
55+
env:
56+
{{- toYaml . | nindent 14 }}
57+
{{- end }}
5458
envFrom:
5559
- configMapRef:
5660
name: {{ include "name" . }}
5761
{{- if $.Values.externalSecrets.enabled }}
5862
- secretRef:
5963
name: {{ $.Values.externalSecrets.secretName }}
6064
{{- end }}
65+
{{- with $.Values.extraEnvFrom }}
66+
{{- toYaml . | nindent 14 }}
67+
{{- end }}
6168
nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
6269
tolerations: {{ toYaml .Values.tolerations | nindent 8 }}
6370
volumes:

chart/templates/ingress.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if $.Values.ingress.enabled }}
12
apiVersion: networking.k8s.io/v1
23
kind: Ingress
34
metadata:
@@ -6,6 +7,17 @@ metadata:
67
name: {{ include "name" . }}
78
namespace: {{ .Release.Namespace }}
89
spec:
10+
{{ if $.Values.ingress.className }}
11+
ingressClassName: {{ .Values.ingress.className }}
12+
{{ end }}
13+
{{- with .Values.ingress.tls }}
14+
tls:
15+
- hosts:
16+
- {{ $.Values.domain | quote }}
17+
{{- with .secretName }}
18+
secretName: {{ . }}
19+
{{- end }}
20+
{{- end }}
921
rules:
1022
- host: {{ .Values.domain }}
1123
http:
@@ -17,3 +29,4 @@ spec:
1729
name: http
1830
path: {{ $.Values.ingress.path | default "/" }}
1931
pathType: Prefix
32+
{{- end }}

chart/values.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@ service:
1313
annotations: { }
1414

1515
ingress:
16+
enabled: true
1617
path: "/"
1718
annotations: { }
19+
# className: "nginx"
20+
tls: { }
21+
# secretName: XXX
1822

1923
resources:
2024
requests:
@@ -32,6 +36,9 @@ externalSecrets:
3236
secretStoreName: ""
3337
secretName: ""
3438
parameters: { }
39+
# Allow to environment injections on top or instead of externalSecrets
40+
extraEnvFrom: []
41+
extraEnv: []
3542

3643
autoscaling:
3744
enabled: false

0 commit comments

Comments
 (0)