postgres-deployment.yaml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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:
  6. replicas: {{ (default 1 .Values.replicas) }}
  7. strategy:
  8. type: Recreate
  9. selector:
  10. matchLabels:
  11. app: {{ template "common.names.name" . }}
  12. release: {{ .Release.Name }}
  13. template: {{ include "common.deployment.pod.metadata" $values | nindent 4 }}
  14. spec:
  15. containers:
  16. - name: {{ .Chart.Name }}-{{ include "postgres.nameSuffix" .}}
  17. image: {{ template "postgres.imageName" . }}
  18. imagePullPolicy: {{ .Values.image.pullPolicy }}
  19. env: {{ include "postgres.envVariableConfiguration" $values | nindent 10 }}
  20. volumeMounts: {{ include "postgres.volumeMountsConfiguration" $values | nindent 10 }}
  21. ports:
  22. - name: postgres-tcp
  23. containerPort: 5432
  24. protocol: TCP
  25. readinessProbe:
  26. exec:
  27. command:
  28. - sh
  29. - -c
  30. - "until pg_isready -U${POSTGRES_USER} -h localhost; do sleep 2; done"
  31. initialDelaySeconds: 15
  32. failureThreshold: 5
  33. periodSeconds: 15
  34. timeoutSeconds: 2
  35. livenessProbe:
  36. exec:
  37. command:
  38. - sh
  39. - -c
  40. - "until pg_isready -U${POSTGRES_USER} -h localhost; do sleep 2; done"
  41. initialDelaySeconds: 15
  42. failureThreshold: 5
  43. periodSeconds: 15
  44. timeoutSeconds: 2
  45. startupProbe:
  46. exec:
  47. command:
  48. - sh
  49. - -c
  50. - "until pg_isready -U${POSTGRES_USER} -h localhost; do sleep 2; done"
  51. initialDelaySeconds: 15
  52. failureThreshold: 20
  53. periodSeconds: 15
  54. timeoutSeconds: 2
  55. volumes: {{ include "postgres.volumeConfiguration" $values | nindent 8 }}
  56. {{ end }}