cronjob: fix and update

enable/disable fix.replication & support for CollectionPrefix filtering
fix toleration and nodeSelector helm templating issues
This commit is contained in:
LazyDBA247-Anyvision
2021-02-09 09:46:21 +02:00
parent b6fba0c03f
commit 2646f5a784
2 changed files with 19 additions and 12 deletions

View File

@@ -15,13 +15,13 @@ spec:
backoffLimit: 2 backoffLimit: 2
template: template:
spec: spec:
{{- with .Values.cronjob.nodeSelector }} {{- if .Values.cronjob.nodeSelector }}
nodeSelector: nodeSelector:
{{- toYaml . | nindent 12 }} {{ tpl .Values.cronjob.nodeSelector . | indent 12 | trim }}
{{- end }} {{- end }}
{{- with .Values.cronjob.tolerations }} {{- if .Values.cronjob.tolerations }}
tolerations: tolerations:
{{- toYaml . | nindent 12 }} {{ tpl .Values.cronjob.tolerations . | nindent 12 | trim }}
{{- end }} {{- end }}
restartPolicy: OnFailure restartPolicy: OnFailure
containers: containers:
@@ -39,7 +39,10 @@ spec:
volume.balance -force \ volume.balance -force \
{{ if .Values.volume.dataCenter }} -dataCenter {{ .Values.volume.dataCenter }}{{ end }}\ {{ if .Values.volume.dataCenter }} -dataCenter {{ .Values.volume.dataCenter }}{{ end }}\
{{ if .Values.cronjob.collection }} -collection {{ .Values.cronjob.collection }}{{ end }}\n\ {{ if .Values.cronjob.collection }} -collection {{ .Values.cronjob.collection }}{{ end }}\n\
volume.fix.replication\nunlock\n" | \ {{- if .Values.cronjob.enableFixReplication }}
volume.fix.replication -collectionPattern={{ .Values.cronjob.collectionPattern }} \n\
{{- end }}
unlock\n" | \
/usr/bin/weed shell \ /usr/bin/weed shell \
{{- if .Values.cronjob.master }} {{- if .Values.cronjob.master }}
-master {{ .Values.cronjob.master }} \ -master {{ .Values.cronjob.master }} \

View File

@@ -359,17 +359,21 @@ s3:
storageClass: "" storageClass: ""
cronjob: cronjob:
enabled: false enabled: true
master: "seaweedfs-master:9333"
filer: "seaweedfs-filer-client:8888"
tolerations: ""
nodeSelector: |
sw-backend: "true"
replication:
enable: true
collectionPattern: ""
schedule: "*/7 * * * *" schedule: "*/7 * * * *"
resources: null resources: null
# balance all volumes among volume servers # balance all volumes among volume servers
# ALL|EACH_COLLECTION|<collection_name> # ALL|EACH_COLLECTION|<collection_name>
collection: "" collection: ""
master: ""
filer: ""
tolerations: ""
nodeSelector: |
sw-backend: "true"
certificates: certificates:
commonName: "SeaweedFS CA" commonName: "SeaweedFS CA"