bbgo_origin/charts/bbgo/templates/cronjob_sync.yaml

56 lines
1.7 KiB
YAML
Raw Normal View History

2024-08-23 07:19:07 +00:00
{{- if .Values.sync.enabled }}
2024-08-23 06:19:33 +00:00
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ include "bbgo.fullname" . }}-sync
{{- with .Values.deploymentAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "bbgo.labels" . | nindent 4 }}
spec:
schedule: {{ .Values.sync.schedule | quote }}
jobTemplate:
spec:
template:
spec:
containers:
- name: bbgo
securityContext:
2024-08-23 13:42:30 +00:00
{{- toYaml .Values.securityContext | nindent 14 }}
2024-08-23 06:19:33 +00:00
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
{{- if .Values.metrics.enabled }}
- "--metrics"
- "--metrics-port"
- {{ .Values.metrics.port | quote }}
{{- end }}
- "sync"
- "--config"
- "/config/bbgo.yaml"
2024-08-23 06:22:49 +00:00
{{- if .Values.sync.since }}
- "--since"
- {{ .Values.sync.since | quote }}
{{- end }}
2024-08-23 06:19:33 +00:00
resources:
2024-08-23 13:42:30 +00:00
{{- toYaml .Values.resources | nindent 14 }}
2024-08-23 06:19:33 +00:00
volumeMounts:
- name: config-volume
mountPath: /config
envFrom:
- secretRef:
name: {{ .Values.dotenv.secret | default .Release.Name }}
restartPolicy: OnFailure
volumes:
- name: config-volume
configMap:
{{- if .Values.existingConfigMap }}
name: {{ .Values.existingConfigMap }}
{{- else }}
name: {{ include "bbgo.fullname" . }}
{{- end }}
2024-08-23 07:19:07 +00:00
{{- end -}}