postgres-deployment.yaml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. {{ $values := (. | mustDeepCopy) }}
  2. {{ $_ := set $values "common" (dict "nameSuffix" "postgres") }}
  3. {{ include "common.deployment.common_config" $values | nindent 0 }}
  4. spec: {{ include "common.deployment.common_spec" $values | nindent 2 }}
  5. template: {{ include "common.deployment.pod.metadata" $values | nindent 4 }}
  6. spec:
  7. containers:
  8. - name: {{ .Chart.Name }}-postgres
  9. image: {{ template "postgres.imageName" . }}
  10. imagePullPolicy: {{ .Values.image.pullPolicy }}
  11. env: {{ include "postgres.envVariableConfiguration" $values | nindent 10 }}
  12. volumeMounts: {{ include "postgres.volumeMountsConfiguration" $values | nindent 10 }}
  13. ports:
  14. - name: postgres-tcp
  15. containerPort: 5432
  16. protocol: TCP
  17. readinessProbe:
  18. exec:
  19. command:
  20. - sh
  21. - -c
  22. - "until pg_isready -U ${POSTGRES_USER} -h localhost; do sleep 2; done"
  23. initialDelaySeconds: 10
  24. periodSeconds: 10
  25. timeoutSeconds: 5
  26. failureThreshold: 5
  27. successThreshold: 2
  28. livenessProbe:
  29. exec:
  30. command:
  31. - sh
  32. - -c
  33. - "until pg_isready -U ${POSTGRES_USER} -h localhost; do sleep 2; done"
  34. initialDelaySeconds: 10
  35. periodSeconds: 10
  36. timeoutSeconds: 5
  37. failureThreshold: 5
  38. successThreshold: 1
  39. startupProbe:
  40. exec:
  41. command:
  42. - sh
  43. - -c
  44. - "until pg_isready -U ${POSTGRES_USER} -h localhost; do sleep 2; done"
  45. initialDelaySeconds: 10
  46. periodSeconds: 5
  47. timeoutSeconds: 2
  48. failureThreshold: 60
  49. successThreshold: 1
  50. volumes: {{ include "postgres.volumeConfiguration" $values | nindent 8 }}