logsearchapi-deployment.yaml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. {{ if .Values.logsearchapi.enabled }}
  2. {{ $values := (. | mustDeepCopy) }}
  3. {{ $_ := set $values "common" (dict "nameSuffix" (printf "%s-log" (include "logsearchapi.nameSuffix" .))) }}
  4. {{ $pg_values := (. | mustDeepCopy) }}
  5. {{ $_ := set $pg_values "common" (dict "nameSuffix" (include "postgres.nameSuffix" .)) }}
  6. {{ include "common.deployment.common_config" $values | nindent 0 }}
  7. spec: {{ include "common.deployment.common_spec" $values | nindent 2 }}
  8. template: {{ include "common.deployment.pod.metadata" $values | nindent 4 }}
  9. spec:
  10. initContainers:
  11. - name: {{ .Chart.Name }}-{{ include "logsearchapi.nameSuffix" . }}-waitdb
  12. image: {{ include "postgres.imageName" . }}
  13. imagePullPolicy: {{ .Values.image.pullPolicy }}
  14. env: {{ include "postgresInit.envVariableConfiguration" $pg_values | nindent 10 }}
  15. command:
  16. - sh
  17. - -c
  18. - 'until pg_isready -U "$pgUser" -h "$pgHost"; do sleep 2; done'
  19. containers:
  20. - name: {{ .Chart.Name }}-{{ include "logsearchapi.nameSuffix" . }}
  21. image: {{ include "logsearchapi.imageName" . }}
  22. imagePullPolicy: {{ .Values.logSearchImage.pullPolicy }}
  23. env: {{ include "logsearchapi.envVariableConfiguration" $values | nindent 10 }}
  24. command:
  25. - {{ include "logsearchapi.command" . }}
  26. ports:
  27. - name: logsearchapi
  28. containerPort: 8080
  29. protocol: TCP
  30. readinessProbe:
  31. httpGet:
  32. path: /status
  33. port: 8080
  34. failureThreshold: 5
  35. periodSeconds: 15
  36. initialDelaySeconds: 15
  37. livenessProbe:
  38. httpGet:
  39. path: /status
  40. port: 8080
  41. failureThreshold: 5
  42. periodSeconds: 15
  43. initialDelaySeconds: 15
  44. startupProbe:
  45. httpGet:
  46. path: /status
  47. port: 8080
  48. failureThreshold: 5
  49. periodSeconds: 15
  50. initialDelaySeconds: 15
  51. {{ end }}