synatainer: Update to 0.4.1
This switches to generating a pgpassfile instead of handing over postgres configuration in the environment
This commit is contained in:
parent
927567318a
commit
a34b47f9b7
6 changed files with 36 additions and 7 deletions
|
@ -5,8 +5,8 @@ description: Synapse Maintenance Container
|
||||||
home: https://gitlab.com/mb-saces/synatainer
|
home: https://gitlab.com/mb-saces/synatainer
|
||||||
type: application
|
type: application
|
||||||
|
|
||||||
version: 1.0.0
|
version: 1.1.0
|
||||||
appVersion: "0.4.0"
|
appVersion: 0.4.1
|
||||||
|
|
||||||
maintainers:
|
maintainers:
|
||||||
- name: Alexander Olofsson
|
- name: Alexander Olofsson
|
||||||
|
|
|
@ -49,3 +49,7 @@ Selector labels
|
||||||
app.kubernetes.io/name: {{ include "synatainer.name" . }}
|
app.kubernetes.io/name: {{ include "synatainer.name" . }}
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
{{- define "synatainer.pgpassword" -}}
|
||||||
|
{{- printf "%s:%s:%s:%s" (required "You need to specify a postgres host" .Values.postgresql.host) (.Values.postgresql.port | default 5432 | toString) (.Values.postgresql.database | default "synapse") (.Values.postgresql.username | default "synapse") (required "You need to specify a postgres password" .Values.postgresql.password) }}
|
||||||
|
{{- end }}
|
||||||
|
|
|
@ -6,9 +6,6 @@ metadata:
|
||||||
labels:
|
labels:
|
||||||
{{- include "synatainer.labels" . | nindent 4 }}
|
{{- include "synatainer.labels" . | nindent 4 }}
|
||||||
data:
|
data:
|
||||||
DB_HOST: {{ required "You need to specify a postgres host" .Values.postgresql.host | quote }}
|
|
||||||
DB_NAME: {{ .Values.postgresql.database | default "synapse" | quote }}
|
|
||||||
DB_USER: {{ .Values.postgresql.username | default "synapse" | quote }}
|
|
||||||
SYNAPSE_HOST: {{ .Values.synapse.url | default "http://matrix-synapse:8008" | quote }}
|
SYNAPSE_HOST: {{ .Values.synapse.url | default "http://matrix-synapse:8008" | quote }}
|
||||||
|
|
||||||
{{- range $key, $val := .Values.extraEnv }}
|
{{- range $key, $val := .Values.extraEnv }}
|
||||||
|
|
|
@ -29,7 +29,13 @@ spec:
|
||||||
securityContext:
|
securityContext:
|
||||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- command:
|
||||||
|
- sh
|
||||||
|
- -c
|
||||||
|
- |
|
||||||
|
cp /tmp/pgpassword /conf/
|
||||||
|
exec /entrypoint.sh
|
||||||
|
name: {{ .Chart.Name }}
|
||||||
envFrom:
|
envFrom:
|
||||||
- configMapRef:
|
- configMapRef:
|
||||||
name: {{ include "synatainer.fullname" . }}
|
name: {{ include "synatainer.fullname" . }}
|
||||||
|
@ -41,6 +47,12 @@ spec:
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.resources | nindent 12 }}
|
{{- toYaml .Values.resources | nindent 12 }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: emptydir
|
||||||
|
mountPath: /conf
|
||||||
|
- name: pgpassword
|
||||||
|
mountPath: /tmp/pgpassword
|
||||||
|
subPath: pgpassword
|
||||||
{{- with .Values.nodeSelector }}
|
{{- with .Values.nodeSelector }}
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
|
@ -53,3 +65,10 @@ spec:
|
||||||
tolerations:
|
tolerations:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
volumes:
|
||||||
|
- name: pgpassword
|
||||||
|
secret:
|
||||||
|
secretName: {{ include "synatainer.fullname" . }}-pgpass
|
||||||
|
defaultMode: 0600
|
||||||
|
- name: emptydir
|
||||||
|
emptyDir: {}
|
||||||
|
|
|
@ -1,12 +1,20 @@
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ include "synatainer.fullname" . }}-pgpass
|
||||||
|
labels:
|
||||||
|
{{- include "synatainer.labels" . | nindent 4 }}
|
||||||
|
data:
|
||||||
|
pgpassword: {{ include "synatainer.pgpassword" . | b64enc }}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "synatainer.fullname" . }}
|
name: {{ include "synatainer.fullname" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "synatainer.labels" . | nindent 4 }}
|
{{- include "synatainer.labels" . | nindent 4 }}
|
||||||
data:
|
data:
|
||||||
PGPASSWORD: {{ required "You need to specify a postgres password" .Values.postgresql.password | toString | b64enc }}
|
|
||||||
BEARER_TOKEN: {{ required "You need to specify a synapse token" .Values.synapse.token | toString | b64enc }}
|
BEARER_TOKEN: {{ required "You need to specify a synapse token" .Values.synapse.token | toString | b64enc }}
|
||||||
|
|
||||||
{{- range $key, $val := .Values.extraSecrets }}
|
{{- range $key, $val := .Values.extraSecrets }}
|
||||||
|
|
|
@ -9,6 +9,7 @@ image:
|
||||||
## Connection details for the Synapse database
|
## Connection details for the Synapse database
|
||||||
postgresql:
|
postgresql:
|
||||||
host:
|
host:
|
||||||
|
# port: 5432
|
||||||
# database: synapse
|
# database: synapse
|
||||||
# username: synapse
|
# username: synapse
|
||||||
password:
|
password:
|
||||||
|
|
Loading…
Reference in a new issue