postgres-deployment.yaml 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. {{ $values := . }}
  2. {{ $_ := set $values "common" (dict "nameSuffix" "postgres") }}
  3. apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
  4. kind: Deployment
  5. metadata:
  6. name: {{ template "common.names.fullname" $values }}
  7. labels: {{ include "common.labels.selectorLabels" $values | nindent 4 }}
  8. spec:
  9. replicas: 1
  10. strategy:
  11. type: {{ .Values.nextcloud.strategy }}
  12. selector:
  13. matchLabels: {{- include "common.labels.selectorLabels" $values | nindent 6 }}
  14. template:
  15. metadata:
  16. labels: {{- include "common.labels.selectorLabels" $values | nindent 8 }}
  17. annotations: {{- include "common.annotations" $values | nindent 8 }}
  18. spec:
  19. containers:
  20. - name: {{ .Chart.Name }}-postgres
  21. image: {{ template "postgres.imageName" . }}
  22. imagePullPolicy: {{ .Values.image.pullPolicy }}
  23. env: {{ include "postgres.envVariableConfiguration" $values | nindent 10 }}
  24. volumeMounts:
  25. - name: postgres-data
  26. mountPath: /var/lib/postgresql/data
  27. - name: postgres-backup
  28. mountPath: /postgres_backups
  29. ports:
  30. - name: postgres-tcp
  31. containerPort: 5432
  32. protocol: TCP
  33. volumes: {{ include "postgres.volumeConfiguration" $values | nindent 8 }}