Skip to content

Commit

Permalink
Pass API database configuration through environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Rub21 committed Apr 18, 2024
1 parent ec665eb commit c7b370d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
24 changes: 21 additions & 3 deletions osm-seed/templates/db/db-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,33 @@ spec:
- name: POSTGRES_HOST
value: {{ .Release.Name }}-db
- name: POSTGRES_DB
value: {{ .Values.db.env.POSTGRES_DB }}
value: {{ .Values.db.env.POSTGRES_DB | quote }}
- name: POSTGRES_PASSWORD
value: {{ quote .Values.db.env.POSTGRES_PASSWORD }}
value: {{ quote .Values.db.env.POSTGRES_PASSWORD | quote }}
- name: POSTGRES_USER
value: {{ default "postgres" .Values.db.env.POSTGRES_USER | quote }}
- name: PGUSER
value: {{ default "postgres" .Values.db.env.POSTGRES_USER | quote }}
- name: PGDATA
value: {{ .Values.db.persistenceDisk.mountPath }}
value: {{ .Values.db.persistenceDisk.mountPath | quote }}
- name: POSTGRES_DB_MAX_CONNECTIONS
value: {{ default 100 .Values.db.env.POSTGRES_DB_MAX_CONNECTIONS | quote }}
- name: POSTGRES_DB_SHARED_BUFFERS
value: {{ default "128MB" .Values.db.env.POSTGRES_DB_SHARED_BUFFERS | quote }}
- name: POSTGRES_DB_TEMP_BUFFERS
value: {{ default "8MB" .Values.db.env.POSTGRES_DB_TEMP_BUFFERS | quote }}
- name: POSTGRES_DB_WORK_MEM
value: {{ default "4MB" .Values.db.env.POSTGRES_DB_WORK_MEM | quote }}
- name: POSTGRES_DB_MAINTENANCE_WORK_MEM
value: {{ default "128MB" .Values.db.env.POSTGRES_DB_MAINTENANCE_WORK_MEM | quote }}
- name: POSTGRES_DB_EFFECTIVE_CACHE_SIZE
value: {{ default "4GB" .Values.db.env.POSTGRES_DB_EFFECTIVE_CACHE_SIZE | quote }}
- name: POSTGRES_DB_MAX_WAL_SIZE
value: {{ default "16MB" .Values.db.env.POSTGRES_DB_MAX_WAL_SIZE | quote }}
- name: POSTGRES_DB_MIN_WAL_SIZE
value: {{ default "5MB" .Values.db.env.POSTGRES_DB_MIN_WAL_SIZE | quote }}
- name: POSTGRES_DB_RANDOM_PAGE_COST
value: {{ default "4.0" .Values.db.env.POSTGRES_DB_RANDOM_PAGE_COST | quote }}
- name: POD_IP
valueFrom: { fieldRef: { fieldPath: status.podIP } }
livenessProbe:
Expand Down
11 changes: 10 additions & 1 deletion osm-seed/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,16 @@ db:
env:
POSTGRES_DB: openstreetmap
POSTGRES_USER: postgres
POSTGRES_PASSWORD: "1234"
POSTGRES_PASSWORD: "abc"
POSTGRES_DB_MAX_CONNECTIONS: 100
POSTGRES_DB_SHARED_BUFFERS: 128MB
POSTGRES_DB_TEMP_BUFFERS: 8MB
POSTGRES_DB_WORK_MEM: 4MB
POSTGRES_DB_MAINTENANCE_WORK_MEM: 128MB
POSTGRES_DB_EFFECTIVE_CACHE_SIZE: 4GB
POSTGRES_DB_MAX_WAL_SIZE: 16MB
POSTGRES_DB_MIN_WAL_SIZE: 5MB
POSTGRES_DB_RANDOM_PAGE_COST: 4.0
persistenceDisk:
enabled: false
mountPath: /var/lib/postgresql/data
Expand Down

0 comments on commit c7b370d

Please sign in to comment.