es-lookback-cronjob.yaml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. {{- if .Values.esLookback.enabled -}}
  2. apiVersion: {{ include "common.capabilities.cronjob.apiVersion" $ }}
  3. kind: CronJob
  4. metadata:
  5. name: {{ include "jaeger.fullname" . }}-es-lookback
  6. labels:
  7. {{- include "jaeger.labels" . | nindent 4 }}
  8. app.kubernetes.io/component: es-lookback
  9. {{- if .Values.esLookback.annotations }}
  10. annotations:
  11. {{- toYaml .Values.esLookback.annotations | nindent 4 }}
  12. {{- end }}
  13. spec:
  14. concurrencyPolicy: {{ .Values.esLookback.concurrencyPolicy }}
  15. schedule: {{ .Values.esLookback.schedule | quote }}
  16. successfulJobsHistoryLimit: {{ .Values.esLookback.successfulJobsHistoryLimit }}
  17. failedJobsHistoryLimit: {{ .Values.esLookback.failedJobsHistoryLimit }}
  18. suspend: false
  19. jobTemplate:
  20. spec:
  21. {{- if .Values.esLookback.activeDeadlineSeconds }}
  22. activeDeadlineSeconds: {{ .Values.esLookback.activeDeadlineSeconds }}
  23. {{- end }}
  24. {{- if .Values.esLookback.ttlSecondsAfterFinished }}
  25. ttlSecondsAfterFinished: {{ .Values.esLookback.ttlSecondsAfterFinished }}
  26. {{- end }}
  27. template:
  28. metadata:
  29. {{- if .Values.esLookback.podAnnotations }}
  30. annotations:
  31. {{- toYaml .Values.esLookback.podAnnotations | nindent 12 }}
  32. {{- end }}
  33. labels:
  34. {{- include "jaeger.selectorLabels" . | nindent 12 }}
  35. app.kubernetes.io/component: es-lookback
  36. {{- if .Values.esLookback.podLabels }}
  37. {{- toYaml .Values.esLookback.podLabels | nindent 12 }}
  38. {{- end }}
  39. spec:
  40. serviceAccountName: {{ template "jaeger.esLookback.serviceAccountName" . }}
  41. {{- with .Values.esLookback.imagePullSecrets }}
  42. imagePullSecrets:
  43. {{- toYaml . | nindent 12 }}
  44. {{- end }}
  45. securityContext:
  46. {{- toYaml .Values.esLookback.podSecurityContext | nindent 12 }}
  47. restartPolicy: OnFailure
  48. {{- with .Values.esLookback.nodeSelector }}
  49. nodeSelector:
  50. {{- toYaml . | nindent 12 }}
  51. {{- end }}
  52. {{- with .Values.esLookback.affinity }}
  53. affinity:
  54. {{- toYaml . | nindent 12 }}
  55. {{- end }}
  56. {{- with .Values.esLookback.tolerations }}
  57. tolerations:
  58. {{- toYaml . | nindent 12 }}
  59. {{- end }}
  60. containers:
  61. - name: {{ include "jaeger.fullname" . }}-es-lookback
  62. securityContext:
  63. {{- toYaml .Values.esLookback.securityContext | nindent 14 }}
  64. image: "{{ .Values.esLookback.image }}:{{- include "jaeger.image.tag" . }}"
  65. imagePullPolicy: {{ .Values.esLookback.pullPolicy }}
  66. args:
  67. - lookback
  68. - {{ include "elasticsearch.client.url" . }}
  69. {{ include "extra.cmdArgs" ( dict "cmdlineParams" .Values.esLookback.cmdlineParams ) | nindent 14 }}
  70. env:
  71. {{ include "elasticsearch.env" . | nindent 14 }}
  72. {{- if .Values.esLookback.extraEnv }}
  73. {{- toYaml .Values.esLookback.extraEnv | nindent 14 }}
  74. {{- end }}
  75. resources:
  76. {{- toYaml .Values.esLookback.resources | nindent 14 }}
  77. volumeMounts:
  78. {{- range .Values.esLookback.extraConfigmapMounts }}
  79. - name: {{ .name }}
  80. mountPath: {{ .mountPath }}
  81. subPath: {{ .subPath }}
  82. readOnly: {{ .readOnly }}
  83. {{- end }}
  84. {{- range .Values.esLookback.extraSecretMounts }}
  85. - name: {{ .name }}
  86. mountPath: {{ .mountPath }}
  87. subPath: {{ .subPath }}
  88. readOnly: {{ .readOnly }}
  89. {{- end }}
  90. {{- if .Values.storage.elasticsearch.tls.enabled }}
  91. - name: {{ .Values.storage.elasticsearch.tls.secretName }}
  92. mountPath: "/es-tls/ca-cert.pem"
  93. subPath: "ca-cert.pem"
  94. readOnly: true
  95. {{- end }}
  96. volumes:
  97. {{- range .Values.esLookback.extraConfigmapMounts }}
  98. - name: {{ .name }}
  99. configMap:
  100. name: {{ .configMap }}
  101. {{- end }}
  102. {{- range .Values.esLookback.extraSecretMounts }}
  103. - name: {{ .name }}
  104. secret:
  105. secretName: {{ .secretName }}
  106. {{- end }}
  107. {{- if .Values.storage.elasticsearch.tls.enabled }}
  108. - name: {{ .Values.storage.elasticsearch.tls.secretName }}
  109. secret:
  110. secretName: {{ .Values.storage.elasticsearch.tls.secretName }}
  111. {{- end }}
  112. {{- end -}}