es-rollover-hook.yml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. {{- if .Values.esRollover.enabled -}}
  2. apiVersion: batch/v1
  3. kind: Job
  4. metadata:
  5. name: {{ include "jaeger.fullname" . }}-es-rollover-init
  6. labels:
  7. {{- include "jaeger.labels" . | nindent 4 }}
  8. app.kubernetes.io/component: es-rollover-init
  9. annotations:
  10. "helm.sh/hook": pre-install,pre-upgrade
  11. "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
  12. {{- if .Values.esRollover.initHook.annotations }}
  13. {{- toYaml .Values.esRollover.initHook.annotations | nindent 4 }}
  14. {{- end }}
  15. spec:
  16. {{- if .Values.esRollover.initHook.activeDeadlineSeconds }}
  17. activeDeadlineSeconds: {{ .Values.esRollover.initHook.activeDeadlineSeconds }}
  18. {{- end }}
  19. {{- with .Values.esRollover.initHook.ttlSecondsAfterFinished }}
  20. ttlSecondsAfterFinished: {{ . }}
  21. {{- end }}
  22. template:
  23. metadata:
  24. {{- with .Values.esRollover.initHook.podAnnotations }}
  25. annotations: {{- toYaml . | nindent 8 }}
  26. {{- end }}
  27. labels:
  28. {{- include "jaeger.selectorLabels" . | nindent 8 }}
  29. app.kubernetes.io/component: es-rollover-init
  30. {{- if .Values.esRollover.initHook.podLabels }}
  31. {{- toYaml .Values.esRollover.initHook.podLabels | nindent 10 }}
  32. {{- end }}
  33. spec:
  34. serviceAccountName: {{ template "jaeger.esRollover.serviceAccountName" . }}
  35. {{- with .Values.esRollover.imagePullSecrets }}
  36. imagePullSecrets: {{- toYaml . | nindent 8 }}
  37. {{- end }}
  38. securityContext: {{- toYaml .Values.esRollover.podSecurityContext | nindent 8 }}
  39. restartPolicy: OnFailure
  40. {{- with .Values.esRollover.nodeSelector }}
  41. nodeSelector: {{- toYaml . | nindent 8 }}
  42. {{- end }}
  43. {{- with .Values.esRollover.affinity }}
  44. affinity: {{- toYaml . | nindent 8 }}
  45. {{- end }}
  46. {{- with .Values.esRollover.tolerations }}
  47. tolerations: {{- toYaml . | nindent 8 }}
  48. {{- end }}
  49. containers:
  50. - name: {{ include "jaeger.fullname" . }}-es-rollover-init
  51. securityContext: {{- toYaml .Values.esRollover.securityContext | nindent 12 }}
  52. image: "{{ .Values.esRollover.image }}:{{ .Values.esRollover.tag }}"
  53. imagePullPolicy: {{ .Values.esRollover.pullPolicy }}
  54. args:
  55. - init
  56. - {{ include "elasticsearch.client.url" . }}
  57. {{ include "extra.cmdArgs" ( dict "cmdlineParams" .Values.esRollover.cmdlineParams ) | nindent 12 }}
  58. env:
  59. {{ include "elasticsearch.env" . | nindent 12 }}
  60. {{- with .Values.esRollover.initHook.extraEnv }}
  61. {{- toYaml . | nindent 12 }}
  62. {{- end }}
  63. resources: {{- toYaml .Values.esRollover.resources | nindent 12 }}
  64. volumeMounts:
  65. {{- range .Values.esRollover.extraConfigmapMounts }}
  66. - name: {{ .name }}
  67. mountPath: {{ .mountPath }}
  68. subPath: {{ .subPath }}
  69. readOnly: {{ .readOnly }}
  70. {{- end }}
  71. {{- range .Values.esRollover.extraSecretMounts }}
  72. - name: {{ .name }}
  73. mountPath: {{ .mountPath }}
  74. subPath: {{ .subPath }}
  75. readOnly: {{ .readOnly }}
  76. {{- end }}
  77. volumes:
  78. {{- range .Values.esRollover.extraConfigmapMounts }}
  79. - name: {{ .name }}
  80. configMap:
  81. name: {{ .configMap }}
  82. {{- end }}
  83. {{- range .Values.esRollover.extraSecretMounts }}
  84. - name: {{ .name }}
  85. secret:
  86. secretName: {{ .secretName }}
  87. {{- end }}
  88. {{- end -}}