Skip to content

Commit 1f566be

Browse files
committed
Update: migration guide and README for external PostgreSQL requirement; enhance deployment.yaml with DATABASE_URL env vars
1 parent 17ff1dd commit 1f566be

File tree

7 files changed

+33
-20
lines changed

7 files changed

+33
-20
lines changed

MIGRATION.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ This guide helps you migrate from previous versions of the Kudos Helm chart to v
99
- **Configuration structure changed**: Database connection settings are completely different
1010
- **No backward compatibility**: Complete migration required
1111

12-
## Why This Change?
13-
14-
This change follows the **KISS principle** (Keep It Simple, Stupid):
15-
- **Separation of concerns**: Database administration is distinct from application deployment
16-
- **Production ready**: External databases offer better reliability, backup, and scaling
17-
- **Flexibility**: Choose your preferred database hosting solution
18-
- **Reduced complexity**: Kudos focuses on the application, not database operations
19-
2012
## Pre-Migration Requirements
2113

2214
1. **Set up an external PostgreSQL database** (see [DATABASE_SETUP.md](../DATABASE_SETUP.md))

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ KUDOS_MIGRATE="1"
6767

6868
### Database Setup
6969

70-
**Important**: Starting with Helm Chart v2.0.0, Kudos requires an external PostgreSQL database. The application no longer manages database infrastructure to follow KISS principles and production best practices.
70+
**Important**: Starting with Helm Chart v2.0.0, Kudos requires an external PostgreSQL database. The application no longer manages database infrastructure.
7171

7272
📖 **See [DATABASE_SETUP.md](DATABASE_SETUP.md)** for comprehensive instructions on setting up PostgreSQL for Kudos, including:
7373
- Cloud database services (AWS RDS, Google Cloud SQL, Azure Database)

docs/helm/index.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ entries:
66
licenses: MIT
77
apiVersion: v2
88
appVersion: 1.2.1
9-
created: "2025-09-17T16:38:46.950966+02:00"
9+
created: "2025-09-17T16:42:29.997157+02:00"
1010
description: Kudos Helm chart for deploying social recognition platform
11-
digest: b6713b3c4c8acbc290270670cb7da86bc7db64121e1babe380aef0b3c675ffcc
11+
digest: 3db9f6b21d15cc5b91f18e491d6b42baba7519084c6a33a62c1a1fca261147fc
1212
keywords:
1313
- kudos
1414
- social
@@ -22,7 +22,7 @@ entries:
2222
version: 2.0.0
2323
- apiVersion: v2
2424
appVersion: 1.2.1
25-
created: "2025-09-17T16:38:46.950763+02:00"
25+
created: "2025-09-17T16:42:29.996928+02:00"
2626
dependencies:
2727
- condition: postgresql.enabled
2828
name: postgresql
@@ -37,7 +37,7 @@ entries:
3737
version: 0.2.1
3838
- apiVersion: v2
3939
appVersion: 1.2.0
40-
created: "2025-09-17T16:38:46.94897+02:00"
40+
created: "2025-09-17T16:42:29.99512+02:00"
4141
dependencies:
4242
- condition: postgresql.enabled
4343
name: postgresql
@@ -52,7 +52,7 @@ entries:
5252
version: 0.2.0
5353
- apiVersion: v2
5454
appVersion: 1.2.0
55-
created: "2025-09-17T16:38:46.946448+02:00"
55+
created: "2025-09-17T16:42:29.993246+02:00"
5656
dependencies:
5757
- condition: postgresql.enabled
5858
name: postgresql
@@ -65,4 +65,4 @@ entries:
6565
urls:
6666
- https://synyx.github.io/kudos/docs/helm/kudos-0.1.1.tgz
6767
version: 0.1.1
68-
generated: "2025-09-17T16:38:46.943837+02:00"
68+
generated: "2025-09-17T16:42:29.990771+02:00"

docs/helm/kudos-2.0.0.tgz

-2 Bytes
Binary file not shown.

helm/kudos/templates/_helpers.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ PostgreSQL password secret key
8484
{{- end }}
8585

8686
{{/*
87-
Build DATABASE_URL from components
87+
Build DATABASE_URL with environment variable substitution
8888
*/}}
8989
{{- define "kudos.postgresql.connectionString" -}}
9090
{{- $host := .Values.postgresql.host }}
91-
{{- $port := .Values.postgresql.port | default 5432 }}
91+
{{- $port := .Values.postgresql.port | default 5432 | int }}
9292
{{- $database := .Values.postgresql.database | default "kudos" }}
9393
{{- $sslMode := .Values.postgresql.sslMode | default "disable" }}
9494
{{- $baseUrl := printf "postgresql://$(DATABASE_USER):$(DATABASE_PASSWORD)@%s:%d/%s" $host $port $database }}

helm/kudos/templates/deployment.yaml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ metadata:
66
labels:
77
{{- include "kudos.labels" . | nindent 4 }}
88
spec:
9-
{{- if not .Values.autoscaling.enabled }}
109
replicas: {{ .Values.replicaCount }}
11-
{{- end }}
1210
selector:
1311
matchLabels:
1412
{{- include "kudos.selectorLabels" . | nindent 6 }}
@@ -34,6 +32,16 @@ spec:
3432
command: ["npm"]
3533
args: ["run", "db:migrate"]
3634
env:
35+
- name: DATABASE_USER
36+
valueFrom:
37+
secretKeyRef:
38+
name: {{ include "kudos.postgresql.secretName" . }}
39+
key: {{ include "kudos.postgresql.usernameKey" . }}
40+
- name: DATABASE_PASSWORD
41+
valueFrom:
42+
secretKeyRef:
43+
name: {{ include "kudos.postgresql.secretName" . }}
44+
key: {{ include "kudos.postgresql.passwordKey" . }}
3745
- name: DATABASE_URL
3846
value: {{ include "kudos.postgresql.connectionString" . | quote }}
3947
resources:
@@ -56,6 +64,16 @@ spec:
5664
env:
5765
- name: ORIGIN
5866
value: {{ .Values.app.origin | quote }}
67+
- name: DATABASE_USER
68+
valueFrom:
69+
secretKeyRef:
70+
name: {{ include "kudos.postgresql.secretName" . }}
71+
key: {{ include "kudos.postgresql.usernameKey" . }}
72+
- name: DATABASE_PASSWORD
73+
valueFrom:
74+
secretKeyRef:
75+
name: {{ include "kudos.postgresql.secretName" . }}
76+
key: {{ include "kudos.postgresql.passwordKey" . }}
5977
- name: DATABASE_URL
6078
value: {{ include "kudos.postgresql.connectionString" . | quote }}
6179
- name: KUDOS_MIGRATION

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
"db:generate": "drizzle-kit generate",
1919
"db:push": "drizzle-kit push",
2020
"db:migrate": "drizzle-kit migrate",
21-
"db:studio": "drizzle-kit studio"
21+
"db:studio": "drizzle-kit studio",
22+
"helm:release": "echo 'Packaging Helm chart...' && helm package helm/kudos -d docs/helm/ && echo 'Updating repository index...' && helm repo index docs/helm/ --url https://synyx.github.io/kudos/docs/helm && echo 'Helm release complete! 🎉'",
23+
"helm:lint": "helm lint helm/kudos",
24+
"helm:template": "helm template test-release helm/kudos --values helm/kudos/values.yaml"
2225
},
2326
"devDependencies": {
2427
"@eslint/compat": "^1.2.5",

0 commit comments

Comments
 (0)