Skip to content

Commit 2c7d6a0

Browse files
syphernlshahargl
andauthored
feat: add support for env from secrets/configmaps (#119)
* chore: add support for env from secrets/configmaps * bump version --------- Co-authored-by: Shahar Glazner <[email protected]>
1 parent ed096a4 commit 2c7d6a0

File tree

5 files changed

+108
-3
lines changed

5 files changed

+108
-3
lines changed

charts/keep/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: keep
3-
version: 0.1.60
3+
version: 0.1.61
44
description: Keep Helm Chart
55
type: application
66
icon: https://platform.keephq.dev/_next/image?url=%2Fkeep.png&w=48&q=75

charts/keep/README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# keep
22

3-
![Version: 0.1.50](https://img.shields.io/badge/Version-0.1.50-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.32.1](https://img.shields.io/badge/AppVersion-0.32.1-informational?style=flat-square)
3+
![Version: 0.1.61](https://img.shields.io/badge/Version-0.1.61-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.34.5](https://img.shields.io/badge/AppVersion-0.34.5-informational?style=flat-square)
44

55
Keep Helm Chart
66

@@ -39,6 +39,10 @@ Keep Helm Chart
3939
| backend.databaseConnectionStringFromSecret.secretKey | string | `""` | |
4040
| backend.databaseConnectionStringFromSecret.secretName | string | `""` | |
4141
| backend.enabled | bool | `true` | |
42+
| backend.envFromConfigMaps | list | `[]` | configmaps to include. Must include name and can be marked as optional. each entry should contain a name key, and can optionally specify whether the configmap must be defined with an optional key. |
43+
| backend.envFromSecret | string | `""` | Name of the secret to include |
44+
| backend.envFromSecrets | list | `[]` | List of secrets to include. Must include name and can be marked as optional. |
45+
| backend.envRenderSecret | object | `{}` | Sensible environment variables will be rendered as a new secret object; escape {{ in secret values to avoid Helm interpretation. |
4246
| backend.env[0].name | string | `"DATABASE_CONNECTION_STRING"` | |
4347
| backend.env[0].value | string | `"mysql+pymysql://root@keep-database:3306/keep"` | |
4448
| backend.env[1].name | string | `"DATABASE_NAME"` | |
@@ -57,6 +61,8 @@ Keep Helm Chart
5761
| backend.env[7].value | string | `"keep-websocket"` | |
5862
| backend.env[8].name | string | `"PUSHER_PORT"` | |
5963
| backend.env[8].value | int | `6001` | |
64+
| backend.env[9].name | string | `"PROMETHEUS_MULTIPROC_DIR"` | |
65+
| backend.env[9].value | string | `"/tmp/prometheus"` | |
6066
| backend.extraInitContainers | list | `[]` | |
6167
| backend.extraVolumeMounts | list | `[]` | |
6268
| backend.extraVolumes | list | `[]` | |
@@ -71,7 +77,9 @@ Keep Helm Chart
7177
| backend.nodeSelector | object | `{}` | |
7278
| backend.openAiApi.enabled | bool | `false` | |
7379
| backend.openAiApi.openAiApiKey | string | `""` | |
74-
| backend.podAnnotations | object | `{}` | |
80+
| backend.podAnnotations."prometheus.io/path" | string | `"/metrics/processing"` | |
81+
| backend.podAnnotations."prometheus.io/port" | string | `"8080"` | |
82+
| backend.podAnnotations."prometheus.io/scrape" | string | `"true"` | |
7583
| backend.podSecurityContext | object | `{}` | |
7684
| backend.replicaCount | int | `1` | |
7785
| backend.resources | object | `{}` | |
@@ -84,6 +92,7 @@ Keep Helm Chart
8492
| backend.service.port | int | `8080` | |
8593
| backend.service.type | string | `"ClusterIP"` | |
8694
| backend.tolerations | list | `[]` | |
95+
| backend.topologySpreadConstraints | list | `[]` | |
8796
| backend.waitForDatabase.enabled | bool | `true` | |
8897
| backend.waitForDatabase.port | int | `3306` | |
8998
| database.affinity | object | `{}` | |
@@ -136,6 +145,10 @@ Keep Helm Chart
136145
| frontend.backendConfig.healthCheck.type | string | `"HTTP"` | |
137146
| frontend.backendConfig.healthCheck.unhealthyThreshold | int | `3` | |
138147
| frontend.enabled | bool | `true` | |
148+
| frontend.envFromConfigMaps | list | `[]` | Configmaps to include. Must include name and can be marked as optional. each entry should contain a name key, and can optionally specify whether the configmap must be defined with an optional key. |
149+
| frontend.envFromSecret | string | `""` | Name of the secret to include |
150+
| frontend.envFromSecrets | list | `[]` | List of secrets to include. Must include name and can be marked as optional. |
151+
| frontend.envRenderSecret | object | `{}` | Sensible environment variables will be rendered as a new secret object; escape {{ in secret values to avoid Helm interpretation. |
139152
| frontend.env[0].name | string | `"NEXTAUTH_SECRET"` | |
140153
| frontend.env[0].value | string | `"secret"` | |
141154
| frontend.env[1].name | string | `"VERCEL"` | |
@@ -173,6 +186,7 @@ Keep Helm Chart
173186
| frontend.serviceAccount.create | bool | `true` | |
174187
| frontend.serviceAccount.name | string | `""` | |
175188
| frontend.tolerations | list | `[]` | |
189+
| frontend.topologySpreadConstraints | list | `[]` | |
176190
| fullnameOverride | string | `""` | |
177191
| global.ingress.annotations | object | `{}` | |
178192
| global.ingress.backendPrefix | string | `"/v2"` | |
@@ -233,6 +247,7 @@ Keep Helm Chart
233247
| websocket.serviceAccount.create | bool | `true` | |
234248
| websocket.serviceAccount.name | string | `""` | |
235249
| websocket.tolerations | list | `[]` | |
250+
| websocket.topologySpreadConstraints | list | `[]` | |
236251

237252
----------------------------------------------
238253
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)

charts/keep/templates/backend.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,33 @@ spec:
8787
name: {{ .Values.backend.databaseConnectionStringFromSecret.secretName }}
8888
key: {{ .Values.backend.databaseConnectionStringFromSecret.secretKey }}
8989
{{- end }}
90+
{{- if or .Values.backend.envFromSecret (or .Values.backend.envRenderSecret .Values.backend.envFromSecrets) .Values.backend.envFromConfigMaps }}
91+
envFrom:
92+
{{- if .Values.backend.envFromSecret }}
93+
- secretRef:
94+
name: {{ tpl .Values.backend.envFromSecret . }}
95+
{{- end }}
96+
{{- if .Values.backend.envRenderSecret }}
97+
- secretRef:
98+
name: {{ include "keep.fullname" . }}-backend-env
99+
{{- end }}
100+
{{- range .Values.backend.envFromSecrets }}
101+
- secretRef:
102+
name: {{ tpl .name $ }}
103+
optional: {{ .optional | default false }}
104+
{{- if .prefix }}
105+
prefix: {{ tpl .prefix $ }}
106+
{{- end }}
107+
{{- end }}
108+
{{- range .Values.backend.envFromConfigMaps }}
109+
- configMapRef:
110+
name: {{ tpl .name $ }}
111+
optional: {{ .optional | default false }}
112+
{{- if .prefix }}
113+
prefix: {{ tpl .prefix $ }}
114+
{{- end }}
115+
{{- end }}
116+
{{- end }}
90117
volumeMounts:
91118
- name: state-volume
92119
mountPath: /state

charts/keep/templates/frontend.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,33 @@ spec:
6060
value: {{ .value | quote }}
6161
{{- end }}
6262
{{- end }}
63+
{{- if or .Values.frontend.envFromSecret (or .Values.frontend.envRenderSecret .Values.frontend.envFromSecrets) .Values.frontend.envFromConfigMaps }}
64+
envFrom:
65+
{{- if .Values.frontend.envFromSecret }}
66+
- secretRef:
67+
name: {{ tpl .Values.frontend.envFromSecret . }}
68+
{{- end }}
69+
{{- if .Values.frontend.envRenderSecret }}
70+
- secretRef:
71+
name: {{ include "keep.fullname" . }}-frontend-env
72+
{{- end }}
73+
{{- range .Values.frontend.envFromSecrets }}
74+
- secretRef:
75+
name: {{ tpl .name $ }}
76+
optional: {{ .optional | default false }}
77+
{{- if .prefix }}
78+
prefix: {{ tpl .prefix $ }}
79+
{{- end }}
80+
{{- end }}
81+
{{- range .Values.frontend.envFromConfigMaps }}
82+
- configMapRef:
83+
name: {{ tpl .name $ }}
84+
optional: {{ .optional | default false }}
85+
{{- if .prefix }}
86+
prefix: {{ tpl .prefix $ }}
87+
{{- end }}
88+
{{- end }}
89+
{{- end }}
6390
volumeMounts:
6491
- name: state-volume
6592
mountPath: /state

charts/keep/values.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,24 @@ backend:
7979
value: 6001
8080
- name: PROMETHEUS_MULTIPROC_DIR
8181
value: "/tmp/prometheus"
82+
# -- Name of the secret to include
83+
envFromSecret: ""
84+
85+
# -- Sensible environment variables will be rendered as a new secret object; escape {{ in secret values to avoid Helm interpretation.
86+
envRenderSecret: {}
87+
88+
# -- List of secrets to include. Must include name and can be marked as optional.
89+
envFromSecrets: []
90+
# - name: keep-secret-name
91+
# prefix: prefix
92+
# optional: true
93+
94+
# -- configmaps to include. Must include name and can be marked as optional.
95+
# each entry should contain a name key, and can optionally specify whether the configmap must be defined with an optional key.
96+
envFromConfigMaps: []
97+
# - name: keep-env-configmap-name
98+
# prefix: prefix
99+
# optional: true
82100
openAiApi:
83101
enabled: false
84102
openAiApiKey: ""
@@ -156,6 +174,24 @@ frontend:
156174
value: 0.0.0.0
157175
- name: PUSHER_APP_KEY
158176
value: "keepappkey"
177+
# -- Name of the secret to include
178+
envFromSecret: ""
179+
180+
# -- Sensible environment variables will be rendered as a new secret object; escape {{ in secret values to avoid Helm interpretation.
181+
envRenderSecret: {}
182+
183+
# -- List of secrets to include. Must include name and can be marked as optional.
184+
envFromSecrets: []
185+
# - name: keep-secret-name
186+
# prefix: prefix
187+
# optional: true
188+
189+
# -- Configmaps to include. Must include name and can be marked as optional.
190+
# each entry should contain a name key, and can optionally specify whether the configmap must be defined with an optional key.
191+
envFromConfigMaps: []
192+
# - name: keep-env-configmap-name
193+
# prefix: prefix
194+
# optional: true
159195
replicaCount: 1
160196
image:
161197
repository: us-central1-docker.pkg.dev/keephq/keep/keep-ui

0 commit comments

Comments
 (0)