PostgreSQL is now optional + migration on every start

This commit is contained in:
Grégoire Compagnon 2023-08-07 18:58:42 +02:00
parent 701f03d5e8
commit 46718f2c0c
No known key found for this signature in database
GPG Key ID: FCE2B21F080063F4
4 changed files with 18 additions and 10 deletions

View File

@ -1,6 +1,6 @@
dependencies:
- name: postgresql
repository: https://charts.bitnami.com/bitnami/
version: 12.1.9
digest: sha256:71ff342a6c0a98bece3d7fe199983afb2113f8db65a3e3819de875af2c45add7
generated: "2023-01-20T20:42:32.757707004Z"
version: 12.1.15
digest: sha256:b42ad043e9315686145047ac5625e1cb83cd6cfd7abf935f1db5cc3336dadb7f
generated: "2023-07-24T12:08:45.084074+02:00"

View File

@ -19,4 +19,5 @@ dependencies:
- name: postgresql
version: ~12.1.6
repository: "https://charts.bitnami.com/bitnami/"
condition: postgresql.enabled
engine: gotpl

View File

@ -30,6 +30,18 @@ spec:
- /bin/sh
- -c
- until pg_isready -h {{ .Values.config.db.host }} -p {{ .Values.config.db.port }} -U {{ .Values.config.db.user }}; do echo waiting for database; sleep 2; done;
- name: db-migration
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: INVIDIOUS_CONFIG
valueFrom:
configMapKeyRef:
key: INVIDIOUS_CONFIG
name: {{ template "invidious.fullname" . }}
command:
- /invidious/invidious
- --migrate
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
@ -47,8 +59,7 @@ spec:
capabilities:
drop:
- ALL
resources:
{{ toYaml .Values.resources | indent 10 }}
resources: {{ toYaml .Values.resources | nindent 10 }}
readinessProbe:
httpGet:
port: 3000

View File

@ -34,17 +34,13 @@ securityContext:
# See https://github.com/bitnami/charts/tree/master/bitnami/postgresql
postgresql:
enabled: true
image:
tag: 13
auth:
username: kemal
password: kemal
database: invidious
primary:
initdb:
username: kemal
password: kemal
scriptsConfigMap: invidious-postgresql-init
# Adapted from ../config/config.yml
config: