Skip to content

Commit

Permalink
feat: add db pass from secret ability
Browse files Browse the repository at this point in the history
  • Loading branch information
pehlicd committed Mar 23, 2024
1 parent 0c7cb28 commit 258df9e
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 16 deletions.
2 changes: 1 addition & 1 deletion charts/keep/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: keep
version: 0.0.3
version: 0.0.4
description: Keep Helm Chart
type: application
icon: https://platform.keephq.dev/_next/image?url=%2Fkeep.png&w=48&q=75
Expand Down
35 changes: 22 additions & 13 deletions charts/keep/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# keep

![Version: 0.0.3](https://img.shields.io/badge/Version-0.0.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.2.1](https://img.shields.io/badge/AppVersion-0.2.1-informational?style=flat-square)
![Version: 0.0.4](https://img.shields.io/badge/Version-0.0.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.2.1](https://img.shields.io/badge/AppVersion-0.2.1-informational?style=flat-square)

Keep Helm Chart

Expand All @@ -26,25 +26,34 @@ Keep Helm Chart
| backend.autoscaling.maxReplicas | int | `3` | |
| backend.autoscaling.minReplicas | int | `1` | |
| backend.autoscaling.targetCPUUtilizationPercentage | int | `80` | |
| backend.databasePasswordFromSecret.enabled | bool | `false` | |
| backend.databasePasswordFromSecret.secretKey | string | `""` | |
| backend.databasePasswordFromSecret.secretName | string | `""` | |
| backend.enabled | bool | `true` | |
| backend.env[0].name | string | `"SECRET_MANAGER_TYPE"` | |
| backend.env[0].value | string | `"k8s"` | |
| backend.env[10].name | string | `"PUSHER_HOST"` | |
| backend.env[10].value | string | `"keep-websocket"` | |
| backend.env[11].name | string | `"PUSHER_PORT"` | |
| backend.env[11].value | int | `6001` | |
| backend.env[1].name | string | `"PORT"` | |
| backend.env[1].value | string | `"8080"` | |
| backend.env[2].name | string | `"SECRET_MANAGER_DIRECTORY"` | |
| backend.env[2].value | string | `"/state"` | |
| backend.env[3].name | string | `"DATABASE_CONNECTION_STRING"` | |
| backend.env[3].value | string | `"mysql+pymysql://root@keep-database:3306/keep"` | |
| backend.env[4].name | string | `"PUSHER_APP_ID"` | |
| backend.env[4].value | int | `1` | |
| backend.env[5].name | string | `"PUSHER_APP_KEY"` | |
| backend.env[5].value | string | `"keepappkey"` | |
| backend.env[6].name | string | `"PUSHER_APP_SECRET"` | |
| backend.env[6].value | string | `"keepappsecret"` | |
| backend.env[7].name | string | `"PUSHER_HOST"` | |
| backend.env[7].value | string | `"keep-websocket"` | |
| backend.env[8].name | string | `"PUSHER_PORT"` | |
| backend.env[8].value | int | `6001` | |
| backend.env[3].name | string | `"DATABASE_HOST"` | |
| backend.env[3].value | string | `"keep-database"` | |
| backend.env[4].name | string | `"DATABASE_PORT"` | |
| backend.env[4].value | string | `"3306"` | |
| backend.env[5].name | string | `"DATABASE_NAME"` | |
| backend.env[5].value | string | `"keep"` | |
| backend.env[6].name | string | `"DATABASE_USER"` | |
| backend.env[6].value | string | `"root"` | |
| backend.env[7].name | string | `"PUSHER_APP_ID"` | |
| backend.env[7].value | int | `1` | |
| backend.env[8].name | string | `"PUSHER_APP_KEY"` | |
| backend.env[8].value | string | `"keepappkey"` | |
| backend.env[9].name | string | `"PUSHER_APP_SECRET"` | |
| backend.env[9].value | string | `"keepappsecret"` | |
| backend.image.pullPolicy | string | `"Always"` | |
| backend.image.repository | string | `"us-central1-docker.pkg.dev/keephq/keep/keep-api"` | |
| backend.image.tag | string | `"latest"` | |
Expand Down
7 changes: 7 additions & 0 deletions charts/keep/templates/keep-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- if .Values.backend.databasePasswordFromSecret.enabled }}
- name: DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.backend.databasePasswordFromSecret.secretName }}
key: {{ .Values.backend.databasePasswordFromSecret.secretKey }}
{{- end }}
volumeMounts:
- name: state-volume
mountPath: /state
Expand Down
16 changes: 14 additions & 2 deletions charts/keep/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,27 @@ backend:
# if true, wait for the database to be ready before starting the API
# if you use external database, you can set this to false
waitForDatabase: true
# if true, the database password will be read from a secret
# if it is false, the DATABASE_PASSWORD value can be set directly
databasePasswordFromSecret:
enabled: false
secretName: ""
secretKey: ""
env:
- name: SECRET_MANAGER_TYPE
value: k8s
- name: PORT
value: "8080"
- name: SECRET_MANAGER_DIRECTORY
value: /state
- name: DATABASE_CONNECTION_STRING
value: mysql+pymysql://root@keep-database:3306/keep
- name: DATABASE_HOST
value: keep-database
- name: DATABASE_PORT
value: "3306"
- name: DATABASE_NAME
value: keep
- name: DATABASE_USER
value: root
- name: PUSHER_APP_ID
value: 1
- name: PUSHER_APP_KEY
Expand Down

0 comments on commit 258df9e

Please sign in to comment.