123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- {{- if .Values.enterprise.enabled -}}
- {{ if .Values.tokengenJob.enable }}
- {{ $dict := dict "ctx" . "component" "tokengen-job" }}
- apiVersion: batch/v1
- kind: Job
- metadata:
- name: {{ include "tempo.resourceName" $dict }}
- labels:
- {{- include "tempo.labels" $dict | nindent 4 }}
- annotations:
- {{- if .Values.tokengenJob.annotations }}
- {{- toYaml .Values.tokengenJob.annotations | nindent 4 }}
- {{- end }}
- "helm.sh/hook": post-install
- namespace: {{ .Release.Namespace | quote }}
- spec:
- backoffLimit: 6
- completions: 1
- parallelism: 1
- selector:
- template:
- metadata:
- labels:
- {{- include "tempo.podLabels" $dict | nindent 8 }}
- {{- with .Values.tokengenJob.podLabels }}
- {{- toYaml . | nindent 8 }}
- {{- end }}
- namespace: {{ .Release.Namespace | quote }}
- spec:
- serviceAccountName: {{ template "tempo.serviceAccountName" . }}
- {{- if .Values.tokengenJob.priorityClassName }}
- priorityClassName: {{ .Values.tokengenJob.priorityClassName }}
- {{- end }}
- securityContext:
- {{- toYaml .Values.tokengenJob.securityContext | nindent 8 }}
- {{- if .Values.tempo.image.pullSecrets }}
- imagePullSecrets:
- {{- range .Values.tempo.image.pullSecrets }}
- - name: {{ . }}
- {{- end }}
- {{- end }}
- {{- with .Values.tokengenJob.hostAliases }}
- hostAliases:
- {{- toYaml . | nindent 8 }}
- {{- end }}
- initContainers:
- {{- toYaml .Values.tokengenJob.initContainers | nindent 8 }}
- containers:
- - name: tokengen
- image: "{{ include "tempo.imageReference" $dict }}"
- imagePullPolicy: {{ .Values.tempo.image.pullPolicy }}
- args:
- - "-target=tokengen"
- - "-config.expand-env=true"
- - "-config.file=/conf/tempo.yaml"
- {{- range $key, $value := .Values.tokengenJob.extraArgs }}
- - "-{{ $key }}={{ $value }}"
- {{- end }}
- volumeMounts:
- - mountPath: /conf
- name: config
- - mountPath: /runtime-config
- name: runtime-config
- - name: license
- mountPath: /license
- {{- if .Values.tokengenJob.extraVolumeMounts }}
- {{ toYaml .Values.tokengenJob.extraVolumeMounts | nindent 12 }}
- {{- end }}
- env:
- {{- with .Values.global.extraEnv }}
- {{ toYaml . | nindent 12 }}
- {{- end }}
- {{- with .Values.tokengenJob.env }}
- {{ toYaml . | nindent 12 }}
- {{- end }}
- envFrom:
- {{- with .Values.global.extraEnvFrom }}
- {{- toYaml . | nindent 12 }}
- {{- end }}
- {{- with .Values.tokengenJob.extraEnvFrom }}
- {{- toYaml . | nindent 12 }}
- {{- end }}
- securityContext:
- {{- toYaml .Values.tokengenJob.containerSecurityContext | nindent 12 }}
- restartPolicy: OnFailure
- volumes:
- - name: config
- {{- include "tempo.configVolume" . | nindent 10 }}
- - name: runtime-config
- {{- include "tempo.runtimeVolume" . | nindent 10 }}
- {{- if .Values.tokengenJob.extraVolumes }}
- {{ toYaml .Values.tokengenJob.extraVolumes | nindent 8 }}
- {{- end }}
- - name: license
- secret:
- secretName: {{ tpl .Values.license.secretName . }}
- - name: storage
- emptyDir: {}
- {{- end -}}
- {{- end -}}
|