Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[linstor] Improvement of LINSTOR database backup management #187

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions templates/metadata-backup/job_weekly.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{{- define "metadata_backup_resources" }}
cpu: 10m
memory: 25Mi
{{- end }}

{{- if dig "backup" "enabled" true .Values.sdsReplicatedVolume }}
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: metadata-scheduled-backup
namespace: d8-{{ .Chart.Name }}
spec:
schedule: {{ dig "backup" "schedule" "0 3 * * *" .Values.sdsReplicatedVolume }}
concurrencyPolicy: Forbid
failedJobsHistoryLimit: 1
jobTemplate:
spec:
template:
metadata:
namespace: d8-{{ .Chart.Name }}
labels:
app: metadata-backup
spec:
restartPolicy: OnFailure
{{- include "helm_lib_priority_class" (tuple . "cluster-medium") | nindent 10 }}
{{- include "helm_lib_node_selector" (tuple . "system") | nindent 10 }}
{{- include "helm_lib_tolerations" (tuple . "system") | nindent 10 }}
{{- include "helm_lib_module_pod_security_context_run_as_user_nobody" . | nindent 10 }}
imagePullSecrets:
- name: {{ .Chart.Name }}-module-registry
serviceAccount: metadata-backup
serviceAccountName: metadata-backup
containers:
- name: metadata-backup
{{- include "helm_lib_module_container_security_context_read_only_root_filesystem_capabilities_drop_all" . | nindent 12 }}
image: {{ include "helm_lib_module_image" (list . "metadataBackup") }}
imagePullPolicy: IfNotPresent
command:
- /backup.py
- --retentionCount
- {{ dig "backup" "retentionCount" "3" .Values.sdsReplicatedVolume | quote }}
volumeMounts:
- name: tmp
mountPath: /tmp
resources:
requests:
{{- include "helm_lib_module_ephemeral_storage_logs_with_extra" 10 | nindent 16 }}
{{- include "metadata_backup_resources" . | nindent 16 }}
volumes:
- name: tmp
emptyDir: {}
{{- end }}
Loading