postgres-deployment.yaml 1.8 KB

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