Enable longhorn backup
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
f813c839a2
commit
6d35239db7
2 changed files with 50 additions and 18 deletions
|
|
@ -14,26 +14,22 @@
|
|||
create_namespace: yes
|
||||
release_namespace: "{{ storage_longhorn.namespace }}"
|
||||
values:
|
||||
# persistence:
|
||||
# defaultClass: true
|
||||
persistence:
|
||||
defaultClass: true
|
||||
# defaultClassReplicaCount: 3
|
||||
# reclaimPolicy: Delete
|
||||
# recurringJobs:
|
||||
# enable: true
|
||||
# jobList: [
|
||||
# {
|
||||
# "name":"snap",
|
||||
# "task":"snapshot",
|
||||
# "cron":"*/1 * * * *",
|
||||
# "retain":1
|
||||
# },
|
||||
# {
|
||||
# "name":"backup",
|
||||
# "task":"backup",
|
||||
# "cron":"*/2 * * * *",
|
||||
# "retain":1
|
||||
# }
|
||||
# ]
|
||||
recurringJobSelector:
|
||||
enable: true
|
||||
jobList: '[
|
||||
{
|
||||
"name":"snapshot",
|
||||
"isGroup":true,
|
||||
},
|
||||
{
|
||||
"name":"backup-daily",
|
||||
"isGroup":true,
|
||||
}
|
||||
]'
|
||||
defaultSettings:
|
||||
defaultDataPath: "/var/lib/longhorn/"
|
||||
backupTarget: "nfs://longhorn-test-nfs-svc.default:/opt/backupstore"
|
||||
|
|
@ -91,6 +87,27 @@
|
|||
value: "best-effort"
|
||||
}
|
||||
|
||||
- name: Install longhorn Recurring Jobs
|
||||
kubernetes.core.k8s:
|
||||
state: present
|
||||
context: "{{ my_context }}"
|
||||
apply: true
|
||||
namespace: "{{ storage_longhorn.namespace }}"
|
||||
resource_definition: "{{ lookup('template', 'longhorn/longhorn/longhorn_recurringjob.yml.j2') | from_yaml }}"
|
||||
with_items:
|
||||
- {
|
||||
name: "snapshot",
|
||||
cron: "1 * * * *",
|
||||
task: "snapshot",
|
||||
retain: 25
|
||||
}
|
||||
- {
|
||||
name: "backup-daily",
|
||||
cron: "0 1 * * *",
|
||||
task: "backup",
|
||||
retain: 8
|
||||
}
|
||||
|
||||
# - name: Install longhorn UI Ingress
|
||||
# kubernetes.core.k8s:
|
||||
# state: present
|
||||
|
|
|
|||
15
templates/longhorn/longhorn_recurringjob.yml.j2
Normal file
15
templates/longhorn/longhorn_recurringjob.yml.j2
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
apiVersion: longhorn.io/v1beta1
|
||||
kind: RecurringJob
|
||||
metadata:
|
||||
name: "{{ item.name }}"
|
||||
namespace: "{{ storage_longhorn.namespace }}"
|
||||
spec:
|
||||
cron: "{{ item.cron }}"
|
||||
task: "{{ item.task }}"
|
||||
groups:
|
||||
- default
|
||||
retain: {{ item.retain }}
|
||||
concurrency: 2
|
||||
# labels:
|
||||
# label/1: a
|
||||
# label/2: b
|
||||
Loading…
Add table
Add a link
Reference in a new issue