deployment-postgres.yaml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. {{- if .Values.hue.database.create -}}
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: postgres-hue
  6. spec:
  7. selector:
  8. matchLabels:
  9. app: postgres-hue
  10. strategy:
  11. type: Recreate
  12. template:
  13. metadata:
  14. labels:
  15. app: postgres-hue
  16. spec:
  17. containers:
  18. - name: postgres-hue
  19. image: postgres:9.5
  20. env:
  21. - name: POSTGRES_USER
  22. value: {{ .Values.hue.database.user }}
  23. - name: POSTGRES_PASSWORD
  24. value: {{ .Values.hue.database.password }}
  25. - name: POSTGRES_DB
  26. value: {{ .Values.hue.database.name }}
  27. - name: PGDATA
  28. value: /var/lib/postgresql/data/pgdata
  29. ports:
  30. - containerPort: {{ .Values.hue.database.port }}
  31. resources:
  32. requests:
  33. # memory: "350Mi"
  34. cpu: "20m"
  35. volumeMounts:
  36. - mountPath: /var/lib/postgresql/data
  37. name: postgres-data
  38. volumes:
  39. - name: postgres-data
  40. {{ if .Values.hue.database.persist }}
  41. persistentVolumeClaim:
  42. claimName: postgres-pvc
  43. {{ else }}
  44. emptyDir: {}
  45. {{ end }}
  46. {{- end -}}