spark-cronjob.yaml 4.1 KB

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