Files
cloud-host/backend/helm/cloudhost-platform/templates/postgres-deployment.yaml
T
keyhan bf9e827f85 Add cloudhost-platform Helm chart and registry ingress manifests.
Deploy backend, frontend, PostgreSQL, and Redis on Kubernetes with optional Ingress/TLS, SQL migration hooks, and public registry exposure at repo.3fase.ir.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-24 19:01:05 +03:30

67 lines
2.0 KiB
YAML

{{- if .Values.postgres.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "cloudhost-platform.postgres.fullname" . }}
namespace: {{ include "cloudhost-platform.namespace" . }}
labels:
app: {{ include "cloudhost-platform.postgres.fullname" . }}
{{- include "cloudhost-platform.labels" . | nindent 4 }}
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: {{ include "cloudhost-platform.postgres.fullname" . }}
template:
metadata:
labels:
app: {{ include "cloudhost-platform.postgres.fullname" . }}
spec:
containers:
- name: postgres
image: {{ .Values.images.postgres | quote }}
ports:
- containerPort: 5432
env:
- name: POSTGRES_DB
value: {{ .Values.postgres.database | quote }}
- name: POSTGRES_USER
value: {{ .Values.postgres.username | quote }}
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "cloudhost-platform.secretName" . }}
key: postgres-password
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
volumeMounts:
- name: data
mountPath: /var/lib/postgresql/data
livenessProbe:
exec:
command:
- pg_isready
- -U
- {{ .Values.postgres.username }}
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
exec:
command:
- pg_isready
- -U
- {{ .Values.postgres.username }}
initialDelaySeconds: 5
periodSeconds: 5
{{- with .Values.postgres.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
volumes:
- name: data
persistentVolumeClaim:
claimName: {{ include "cloudhost-platform.postgres.fullname" . }}-data
{{- end }}