accounts/deploy/charts/xcontrol/templates/postgres.yaml
2025-07-25 09:52:07 +08:00

44 lines
982 B
YAML

{{- if .Values.postgresql.enabled }}
apiVersion: v1
kind: Service
metadata:
name: xcontrol-postgres
spec:
type: ClusterIP
selector:
app: xcontrol-postgres
ports:
- port: 5432
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: xcontrol-postgres
spec:
replicas: 1
selector:
matchLabels:
app: xcontrol-postgres
template:
metadata:
labels:
app: xcontrol-postgres
spec:
containers:
- name: postgres
image: {{ .Values.postgresql.image }}
env:
- name: POSTGRES_DB
value: {{ .Values.postgresql.auth.database }}
- name: POSTGRES_USER
value: {{ .Values.postgresql.auth.user }}
- name: POSTGRES_PASSWORD
value: {{ .Values.postgresql.auth.password }}
volumeMounts:
- name: data
mountPath: /var/lib/postgresql/data
volumes:
- name: data
emptyDir: {}
{{- end }}