66 lines
2.5 KiB
YAML
66 lines
2.5 KiB
YAML
{{ if .Values.fediblockhole.cron.sync.enabled -}}
|
|
apiVersion: batch/v1
|
|
kind: CronJob
|
|
metadata:
|
|
name: {{ include "fediblockhole.fullname" . }}-sync
|
|
labels:
|
|
{{- include "fediblockhole.labels" . | nindent 4 }}
|
|
spec:
|
|
schedule: {{ .Values.fediblockhole.cron.sync.schedule }}
|
|
failedJobsHistoryLimit: {{ .Values.fediblockhole.cron.sync.failedJobsHistoryLimit }}
|
|
successfulJobsHistoryLimit: {{ .Values.fediblockhole.cron.sync.successfulJobsHistoryLimit }}
|
|
jobTemplate:
|
|
spec:
|
|
template:
|
|
metadata:
|
|
name: {{ include "fediblockhole.fullname" . }}-sync
|
|
{{- with .Values.jobAnnotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
spec:
|
|
restartPolicy: OnFailure
|
|
containers:
|
|
- name: {{ include "fediblockhole.fullname" . }}-sync
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
command:
|
|
- fediblock-sync
|
|
- -c
|
|
- "{{- include "fediblockhole.conf_file_path" . -}}{{- include "fediblockhole.conf_file_filename" . -}}"
|
|
volumeMounts:
|
|
- name: config
|
|
mountPath: {{ include "fediblockhole.conf_file_path" . | quote }}
|
|
{{- with .Values.fediblockhole.allow_file.path }}
|
|
- name: allow
|
|
mountPath: {{ . | quote }}
|
|
{{ end }}
|
|
{{- with .Values.fediblockhole.block_file.path }}
|
|
- name: block
|
|
mountPath: {{ . | quote }}
|
|
{{ end }}
|
|
volumes:
|
|
- name: config
|
|
configMap:
|
|
name: {{ include "fediblockhole.fullname" . }}-conf-toml
|
|
items:
|
|
- key: {{ include "fediblockhole.conf_file_filename" . | quote }}
|
|
path: {{ include "fediblockhole.conf_file_filename" . | quote }}
|
|
{{- with .Values.fediblockhole.allow_file.filename }}
|
|
- name: allow
|
|
configMap:
|
|
name: fediblockhole-allow-csv
|
|
items:
|
|
- key: {{ . | quote }}
|
|
path: {{ . | quote }}
|
|
{{ end }}
|
|
{{- with .Values.fediblockhole.block_file.filename }}
|
|
- name: block
|
|
configMap:
|
|
name: fediblockhole-block-csv
|
|
items:
|
|
- key: {{ . | quote }}
|
|
path: {{ . | quote }}
|
|
{{end }}
|
|
{{- end }}
|