From b4a9d9582e396f51d2aebec8841087643bfbedb5 Mon Sep 17 00:00:00 2001 From: Joe Kerstanoff Date: Tue, 26 Nov 2024 11:51:03 -0500 Subject: [PATCH] Support adding extra env variables to planka deployment dynamically Resolves https://github.com/plankanban/planka/issues/960 --- charts/planka/templates/deployment.yaml | 14 +++++++++++ charts/planka/values.yaml | 32 +++++++++++++++++++------ 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/charts/planka/templates/deployment.yaml b/charts/planka/templates/deployment.yaml index f9e20581..47fa5020 100644 --- a/charts/planka/templates/deployment.yaml +++ b/charts/planka/templates/deployment.yaml @@ -67,6 +67,20 @@ spec: resources: {{- toYaml .Values.resources | nindent 12 }} env: + {{- if .Values.extraEnv }} + {{- range .Values.extraEnv }} + - name: {{ .name }} + {{- if .value }} + value: {{ .value | quote}} + {{- end }} + {{- if .valueFrom }} + valueFrom: + secretKeyRef: + name: {{ .valueFrom.secretName }} + key: {{ .valueFrom.key }} + {{- end }} + {{- end }} + {{- end }} {{- if not .Values.postgresql.enabled }} {{- if .Values.existingDburlSecret }} - name: DATABASE_URL diff --git a/charts/planka/values.yaml b/charts/planka/values.yaml index de9c1bd0..e4b6abc9 100644 --- a/charts/planka/values.yaml +++ b/charts/planka/values.yaml @@ -15,7 +15,7 @@ nameOverride: "" fullnameOverride: "" # Generate a secret using openssl rand -base64 45 -secretkey: "" +secretkey: "88030836190636c899007865fafbf3074afdbe2a184300c75c15a3447a2734f77af6e32847b44993e49771bae9d6a95cd7c355385ba18959d6b9fbf6f1ed1bc2" ## @param existingSecretkeySecret Name of an existing secret containing the session key string ## NOTE: Must contain key `key` @@ -42,10 +42,12 @@ serviceAccount: podAnnotations: {} -podSecurityContext: {} +podSecurityContext: + {} # fsGroup: 2000 -securityContext: {} +securityContext: + {} # capabilities: # drop: # - ALL @@ -65,11 +67,12 @@ service: ingress: enabled: false className: "" - annotations: {} + annotations: + {} # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" hosts: - # Used to set planka BASE_URL if no `baseurl` is provided. + # Used to set planka BASE_URL if no `baseurl` is provided. - host: planka.local paths: - path: / @@ -79,7 +82,8 @@ ingress: # hosts: # - planka.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 @@ -195,5 +199,19 @@ oidc: ## @param oidc.admin.roles The names of the admin groups ## - roles: [] + roles: + [] # - planka-admin + +## Extra environment variables for planka deployment +## Supports hard coded and getting values from a k8s secret +## - name: test +## value: valuetest +## - name: another +## value: another +## - name: test-secret +## valueFrom: +## secretName: k8s-secret-name +## key: key-inside-the-secret +## +extraEnv: []