mirror of
https://github.com/iv-org/invidious.git
synced 2025-08-29 07:58:35 +00:00
Automatic postgresql host discovery
This commit is contained in:
parent
58c32ee32c
commit
704e13bbe8
@ -14,3 +14,14 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
|
|||||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return postgresql host (autogenerated if `postgresql.enabled, user provided else)
|
||||||
|
*/}}
|
||||||
|
{{- define "invidious.pghost" -}}
|
||||||
|
{{- if empty .Values.config.db.host -}}
|
||||||
|
{{ .Release.Name }}-postgresql
|
||||||
|
{{- else -}}
|
||||||
|
{{ .Values.config.db.host }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
@ -1,3 +1,12 @@
|
|||||||
|
{{- define "invidious.pghost_inject" -}}
|
||||||
|
{{- if empty .Values.config.db.host -}}
|
||||||
|
config:
|
||||||
|
db:
|
||||||
|
host: {{ template "invidious.pghost" . }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{ $_ := mergeOverwrite .Values (include "invidious.pghost_inject" . | fromYaml) -}}
|
||||||
|
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -29,7 +29,7 @@ spec:
|
|||||||
args:
|
args:
|
||||||
- /bin/sh
|
- /bin/sh
|
||||||
- -c
|
- -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;
|
- until pg_isready -h {{ template "invidious.pghost" . }} -p {{ .Values.config.db.port }} -U {{ .Values.config.db.user }}; do echo waiting for database; sleep 2; done;
|
||||||
- name: db-migration
|
- name: db-migration
|
||||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
|
@ -65,7 +65,8 @@ config:
|
|||||||
db:
|
db:
|
||||||
user: kemal
|
user: kemal
|
||||||
password: kemal
|
password: kemal
|
||||||
host: invidious-postgresql
|
#-- Leave empty if you use embeded postgresql server
|
||||||
|
host:
|
||||||
port: 5432
|
port: 5432
|
||||||
dbname: invidious
|
dbname: invidious
|
||||||
full_refresh: false
|
full_refresh: false
|
||||||
|
Loading…
Reference in New Issue
Block a user