Spaces:
Paused
Paused
Wilfried ROSET
commited on
Improve helm chart (#1144)
Browse files* [helm] Allow to disable ingress
Signed-off-by: Wilfried Roset <[email protected]>
* [helm] Allow to define the ingress className
Signed-off-by: Wilfried Roset <[email protected]>
* [helm] Allow to define the tls block of the ingress
Signed-off-by: Wilfried Roset <[email protected]>
* [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 <[email protected]>
---------
Signed-off-by: Wilfried Roset <[email protected]>
- chart/templates/deployment.yaml +7 -0
- chart/templates/ingress.yaml +13 -0
- chart/values.yaml +7 -0
chart/templates/deployment.yaml
CHANGED
|
@@ -51,6 +51,10 @@ spec:
|
|
| 51 |
protocol: TCP
|
| 52 |
{{- end }}
|
| 53 |
resources: {{ toYaml .Values.resources | nindent 12 }}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
envFrom:
|
| 55 |
- configMapRef:
|
| 56 |
name: {{ include "name" . }}
|
|
@@ -58,6 +62,9 @@ spec:
|
|
| 58 |
- secretRef:
|
| 59 |
name: {{ $.Values.externalSecrets.secretName }}
|
| 60 |
{{- end }}
|
|
|
|
|
|
|
|
|
|
| 61 |
nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
|
| 62 |
tolerations: {{ toYaml .Values.tolerations | nindent 8 }}
|
| 63 |
volumes:
|
|
|
|
| 51 |
protocol: TCP
|
| 52 |
{{- end }}
|
| 53 |
resources: {{ toYaml .Values.resources | nindent 12 }}
|
| 54 |
+
{{- with $.Values.extraEnv }}
|
| 55 |
+
env:
|
| 56 |
+
{{- toYaml . | nindent 14 }}
|
| 57 |
+
{{- end }}
|
| 58 |
envFrom:
|
| 59 |
- configMapRef:
|
| 60 |
name: {{ include "name" . }}
|
|
|
|
| 62 |
- secretRef:
|
| 63 |
name: {{ $.Values.externalSecrets.secretName }}
|
| 64 |
{{- end }}
|
| 65 |
+
{{- with $.Values.extraEnvFrom }}
|
| 66 |
+
{{- toYaml . | nindent 14 }}
|
| 67 |
+
{{- end }}
|
| 68 |
nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
|
| 69 |
tolerations: {{ toYaml .Values.tolerations | nindent 8 }}
|
| 70 |
volumes:
|
chart/templates/ingress.yaml
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
apiVersion: networking.k8s.io/v1
|
| 2 |
kind: Ingress
|
| 3 |
metadata:
|
|
@@ -6,6 +7,17 @@ metadata:
|
|
| 6 |
name: {{ include "name" . }}
|
| 7 |
namespace: {{ .Release.Namespace }}
|
| 8 |
spec:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
rules:
|
| 10 |
- host: {{ .Values.domain }}
|
| 11 |
http:
|
|
@@ -17,3 +29,4 @@ spec:
|
|
| 17 |
name: http
|
| 18 |
path: {{ $.Values.ingress.path | default "/" }}
|
| 19 |
pathType: Prefix
|
|
|
|
|
|
| 1 |
+
{{- if $.Values.ingress.enabled }}
|
| 2 |
apiVersion: networking.k8s.io/v1
|
| 3 |
kind: Ingress
|
| 4 |
metadata:
|
|
|
|
| 7 |
name: {{ include "name" . }}
|
| 8 |
namespace: {{ .Release.Namespace }}
|
| 9 |
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 }}
|
| 21 |
rules:
|
| 22 |
- host: {{ .Values.domain }}
|
| 23 |
http:
|
|
|
|
| 29 |
name: http
|
| 30 |
path: {{ $.Values.ingress.path | default "/" }}
|
| 31 |
pathType: Prefix
|
| 32 |
+
{{- end }}
|
chart/values.yaml
CHANGED
|
@@ -13,8 +13,12 @@ service:
|
|
| 13 |
annotations: { }
|
| 14 |
|
| 15 |
ingress:
|
|
|
|
| 16 |
path: "/"
|
| 17 |
annotations: { }
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
resources:
|
| 20 |
requests:
|
|
@@ -32,6 +36,9 @@ externalSecrets:
|
|
| 32 |
secretStoreName: ""
|
| 33 |
secretName: ""
|
| 34 |
parameters: { }
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
autoscaling:
|
| 37 |
enabled: false
|
|
|
|
| 13 |
annotations: { }
|
| 14 |
|
| 15 |
ingress:
|
| 16 |
+
enabled: true
|
| 17 |
path: "/"
|
| 18 |
annotations: { }
|
| 19 |
+
# className: "nginx"
|
| 20 |
+
tls: { }
|
| 21 |
+
# secretName: XXX
|
| 22 |
|
| 23 |
resources:
|
| 24 |
requests:
|
|
|
|
| 36 |
secretStoreName: ""
|
| 37 |
secretName: ""
|
| 38 |
parameters: { }
|
| 39 |
+
# Allow to environment injections on top or instead of externalSecrets
|
| 40 |
+
extraEnvFrom: []
|
| 41 |
+
extraEnv: []
|
| 42 |
|
| 43 |
autoscaling:
|
| 44 |
enabled: false
|