fix(postgres): simplify values and templates fix(task): rename list-pods to get-pods fix(vshnPostgres): simplify values and templates
68 lines
1.7 KiB
YAML
68 lines
1.7 KiB
YAML
{{- if .Values.enabled }}
|
|
apiVersion: vshn.appcat.vshn.io/v1
|
|
kind: VSHNPostgreSQL
|
|
metadata:
|
|
name: postgres
|
|
namespace: {{ .Values.namespace }}
|
|
spec:
|
|
parameters:
|
|
service:
|
|
majorVersion: "16"
|
|
pgBouncerSettings:
|
|
pgbouncer:
|
|
admin_users: postgres
|
|
pgSettings:
|
|
timezone: Europe/Zurich
|
|
# FIXME: If enabled instead of the postgres-creds the postgres-odoo secret will be written.
|
|
# access:
|
|
# - user: {{ .Values.namespace }}
|
|
# writeConnectionSecretToRef:
|
|
# name: postgres-{{ .Values.namespace }}
|
|
# namespace: {{ .Values.namespace }}
|
|
security:
|
|
deletionProtection: false
|
|
allowedNamespaces:
|
|
- {{ .Values.namespace }}
|
|
size:
|
|
plan: standard-4
|
|
backup:
|
|
schedule: "30 23 * * *"
|
|
retention: 12
|
|
writeConnectionSecretToRef:
|
|
name: {{ .Values.secretRef }}
|
|
{{- end }}
|
|
{{- if .Values.client.enabled }}
|
|
---
|
|
apiVersion: v1
|
|
kind: Pod
|
|
metadata:
|
|
name: postgres-client
|
|
namespace: {{ .Values.namespace }}
|
|
spec:
|
|
containers:
|
|
- name: postgres-client
|
|
image: postgres:16
|
|
resources:
|
|
limits:
|
|
memory: "128Mi"
|
|
cpu: "500m"
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
args:
|
|
- PGPASSWORD=$POSTGRESQL_PASSWORD psql "sslmode=verify-ca sslrootcert=/etc/secret-volume/ca.crt host=$POSTGRESQL_HOST port=$POSTGRESQL_PORT dbname=$POSTGRESQL_DB" -U $POSTGRESQL_USER -l
|
|
envFrom:
|
|
- secretRef:
|
|
name: {{ .Values.secretRef }}
|
|
volumeMounts:
|
|
- name: secret-volume
|
|
readOnly: true
|
|
mountPath: "/etc/secret-volume"
|
|
volumes:
|
|
- name: secret-volume
|
|
secret:
|
|
defaultMode: 0600
|
|
secretName: {{ .Values.secretRef }}
|
|
restartPolicy: OnFailure
|
|
{{- end }}
|