From b7623ab1c0bdcd69aebcd9f97b123348a4357b39 Mon Sep 17 00:00:00 2001 From: Bart van Dongen <95855742+Bart-vanDongen@users.noreply.github.com> Date: Fri, 2 Aug 2024 21:04:56 +0200 Subject: [PATCH] feat: add support for setting different secrets for environment variables. (#108) * add support for setting different secrets for environment variables. add support of setting specific environment variables * Fix issue with multiple items into single * Update only set files in envFrom --- charts/terrakube/templates/deployment-api.yaml | 6 ++++-- charts/terrakube/templates/deployment-executor.yaml | 6 ++++-- charts/terrakube/templates/deployment-registry.yaml | 6 ++++-- charts/terrakube/values.yaml | 6 ++++++ 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/charts/terrakube/templates/deployment-api.yaml b/charts/terrakube/templates/deployment-api.yaml index 31ae8d4..697eb3c 100644 --- a/charts/terrakube/templates/deployment-api.yaml +++ b/charts/terrakube/templates/deployment-api.yaml @@ -41,8 +41,10 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} envFrom: - - secretRef: - name: terrakube-api-secrets + {{- range .Values.api.secrets }} + - secretRef: + name: {{ .name }} + {{- end }} startupProbe: httpGet: path: /actuator/health diff --git a/charts/terrakube/templates/deployment-executor.yaml b/charts/terrakube/templates/deployment-executor.yaml index 8e70349..c9105b3 100644 --- a/charts/terrakube/templates/deployment-executor.yaml +++ b/charts/terrakube/templates/deployment-executor.yaml @@ -41,8 +41,10 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} envFrom: - - secretRef: - name: terrakube-executor-secrets + {{- range .Values.executor.secrets }} + - secretRef: + name: {{ .name }} + {{- end }} startupProbe: httpGet: path: /actuator/health diff --git a/charts/terrakube/templates/deployment-registry.yaml b/charts/terrakube/templates/deployment-registry.yaml index e4f689a..732dd4a 100644 --- a/charts/terrakube/templates/deployment-registry.yaml +++ b/charts/terrakube/templates/deployment-registry.yaml @@ -41,8 +41,10 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} envFrom: - - secretRef: - name: terrakube-registry-secrets + {{- range .Values.registry.secrets }} + - secretRef: + name: {{ .name }} + {{- end }} startupProbe: httpGet: path: /actuator/health diff --git a/charts/terrakube/values.yaml b/charts/terrakube/values.yaml index ffe4595..705504b 100644 --- a/charts/terrakube/values.yaml +++ b/charts/terrakube/values.yaml @@ -177,6 +177,8 @@ api: replicaCount: "1" serviceType: "ClusterIP" serviceAccountName: "" + secrets: + - terrakube-api-secrets resources: {} podLabels: {} defaultDatabase: true @@ -219,6 +221,8 @@ executor: replicaCount: "1" serviceType: "ClusterIP" serviceAccountName: "" + secrets: + - terrakube-executor-secrets resources: {} podLabels: {} apiServiceUrl: "http://terrakube-api-service:8080" @@ -237,6 +241,8 @@ registry: replicaCount: "1" serviceType: "ClusterIP" serviceAccountName: "" + secrets: + - terrakube-registry-secrets resources: {} podLabels: {} securityContext: {}