From ae6224fe57043121410f6f2e9f00a28d6eda2b90 Mon Sep 17 00:00:00 2001 From: pat-s Date: Mon, 22 Jul 2024 10:01:27 +0200 Subject: [PATCH] use `env` and `envFrom` --- ntfy/templates/_helpers.tpl | 15 --------------- ntfy/templates/deployment.yaml | 9 +++++++++ ntfy/values.yaml | 22 ++++++++++++++++++---- 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/ntfy/templates/_helpers.tpl b/ntfy/templates/_helpers.tpl index 5c1cce1..6904d88 100644 --- a/ntfy/templates/_helpers.tpl +++ b/ntfy/templates/_helpers.tpl @@ -60,18 +60,3 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} - -{{/* -Inject extra environment populated by secrets, if populated -*/}} -{{- define "ntfy.extraSecretEnvironmentVars" -}} -{{- if .extraSecretEnvironmentVars -}} -{{- range .extraSecretEnvironmentVars }} -- name: {{ .envName }} - valueFrom: - secretKeyRef: - name: {{ .secretName }} - key: {{ .secretKey }} -{{- end -}} -{{- end -}} -{{- end -}} diff --git a/ntfy/templates/deployment.yaml b/ntfy/templates/deployment.yaml index c496d54..2c68ac6 100644 --- a/ntfy/templates/deployment.yaml +++ b/ntfy/templates/deployment.yaml @@ -46,6 +46,15 @@ spec: envFrom: - configMapRef: name: {{ include "ntfy.fullname" . }}-env + {{- if .Values.envFrom }} + {{- range .envFrom }} + - name: {{ .envName }} + valueFrom: + secretKeyRef: + name: {{ .secretName }} + key: {{ .secretKey }} + {{- end -}} + {{- end -}} ports: - name: http containerPort: {{ .Values.service.http.port }} diff --git a/ntfy/values.yaml b/ntfy/values.yaml index 67badd8..3e6a740 100644 --- a/ntfy/values.yaml +++ b/ntfy/values.yaml @@ -14,6 +14,16 @@ imagePullSecrets: [] nameOverride: "" fullnameOverride: "" +# - name: +# value: +env: [] +# - name: +# valueFrom: +# secretKeyRef: +# name: +# key: +envFrom: [] + ntfy: baseURL: "https://ntfy.example.org" listen: @@ -141,10 +151,12 @@ serviceAccount: podLabels: {} podAnnotations: {} -podSecurityContext: {} +podSecurityContext: + {} # fsGroup: 2000 -securityContext: {} +securityContext: + {} # capabilities: # drop: # - ALL @@ -165,7 +177,8 @@ service: ingress: enabled: false className: "" - annotations: {} + annotations: + {} # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" hosts: @@ -178,7 +191,8 @@ ingress: # hosts: # - chart-example.local -resources: {} +resources: + {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little # resources, such as Minikube. If you do want to specify resources, uncomment the following