tokengen-job.yaml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. {{- if .Values.enterprise.enabled -}}
  2. {{ if .Values.tokengenJob.enable }}
  3. {{ $dict := dict "ctx" . "component" "tokengen-job" }}
  4. apiVersion: batch/v1
  5. kind: Job
  6. metadata:
  7. name: {{ include "tempo.resourceName" $dict }}
  8. labels:
  9. {{- include "tempo.labels" $dict | nindent 4 }}
  10. annotations:
  11. {{- if .Values.tokengenJob.annotations }}
  12. {{- toYaml .Values.tokengenJob.annotations | nindent 4 }}
  13. {{- end }}
  14. "helm.sh/hook": post-install
  15. namespace: {{ .Release.Namespace | quote }}
  16. spec:
  17. backoffLimit: 6
  18. completions: 1
  19. parallelism: 1
  20. selector:
  21. template:
  22. metadata:
  23. labels:
  24. {{- include "tempo.podLabels" $dict | nindent 8 }}
  25. {{- with .Values.tokengenJob.podLabels }}
  26. {{- toYaml . | nindent 8 }}
  27. {{- end }}
  28. namespace: {{ .Release.Namespace | quote }}
  29. spec:
  30. serviceAccountName: {{ template "tempo.serviceAccountName" . }}
  31. {{- if .Values.tokengenJob.priorityClassName }}
  32. priorityClassName: {{ .Values.tokengenJob.priorityClassName }}
  33. {{- end }}
  34. securityContext:
  35. {{- toYaml .Values.tokengenJob.securityContext | nindent 8 }}
  36. {{- if .Values.tempo.image.pullSecrets }}
  37. imagePullSecrets:
  38. {{- range .Values.tempo.image.pullSecrets }}
  39. - name: {{ . }}
  40. {{- end }}
  41. {{- end }}
  42. {{- with .Values.tokengenJob.hostAliases }}
  43. hostAliases:
  44. {{- toYaml . | nindent 8 }}
  45. {{- end }}
  46. initContainers:
  47. {{- toYaml .Values.tokengenJob.initContainers | nindent 8 }}
  48. containers:
  49. - name: tokengen
  50. image: "{{ include "tempo.imageReference" $dict }}"
  51. imagePullPolicy: {{ .Values.tempo.image.pullPolicy }}
  52. args:
  53. - "-target=tokengen"
  54. - "-config.expand-env=true"
  55. - "-config.file=/conf/tempo.yaml"
  56. {{- range $key, $value := .Values.tokengenJob.extraArgs }}
  57. - "-{{ $key }}={{ $value }}"
  58. {{- end }}
  59. volumeMounts:
  60. - mountPath: /conf
  61. name: config
  62. - mountPath: /runtime-config
  63. name: runtime-config
  64. - name: license
  65. mountPath: /license
  66. {{- if .Values.tokengenJob.extraVolumeMounts }}
  67. {{ toYaml .Values.tokengenJob.extraVolumeMounts | nindent 12 }}
  68. {{- end }}
  69. env:
  70. {{- with .Values.global.extraEnv }}
  71. {{ toYaml . | nindent 12 }}
  72. {{- end }}
  73. {{- with .Values.tokengenJob.env }}
  74. {{ toYaml . | nindent 12 }}
  75. {{- end }}
  76. envFrom:
  77. {{- with .Values.global.extraEnvFrom }}
  78. {{- toYaml . | nindent 12 }}
  79. {{- end }}
  80. {{- with .Values.tokengenJob.extraEnvFrom }}
  81. {{- toYaml . | nindent 12 }}
  82. {{- end }}
  83. securityContext:
  84. {{- toYaml .Values.tokengenJob.containerSecurityContext | nindent 12 }}
  85. restartPolicy: OnFailure
  86. volumes:
  87. - name: config
  88. {{- include "tempo.configVolume" . | nindent 10 }}
  89. - name: runtime-config
  90. {{- include "tempo.runtimeVolume" . | nindent 10 }}
  91. {{- if .Values.tokengenJob.extraVolumes }}
  92. {{ toYaml .Values.tokengenJob.extraVolumes | nindent 8 }}
  93. {{- end }}
  94. - name: license
  95. secret:
  96. secretName: {{ tpl .Values.license.secretName . }}
  97. - name: storage
  98. emptyDir: {}
  99. {{- end -}}
  100. {{- end -}}