From dc72832a889250e4e604f2b4a86e822c41bd2c79 Mon Sep 17 00:00:00 2001 From: GeorgeRaven Date: Mon, 18 Dec 2023 22:09:44 +0000 Subject: [PATCH] Added default volume-snapshot-location --- ...s3-backup.yaml => s3-backup-location.yaml} | 0 .../templates/s3-snapshot-location.yaml | 21 +++++++++++++++++++ .../velero/templates/s3-volume-snapshot.yaml | 21 ------------------- charts/velero/templates/schedule-fs.yaml | 5 ++++- charts/velero/templates/schedule-rbd.yaml | 3 ++- charts/velero/templates/schedule-restic.yaml | 2 +- utils/snapshots/nextcloud-main-snapshot.yaml | 8 +++++++ .../snapshots/nextcloud-mariadb-snapshot.yaml | 8 +++++++ 8 files changed, 44 insertions(+), 24 deletions(-) rename charts/velero/templates/{s3-backup.yaml => s3-backup-location.yaml} (100%) create mode 100644 charts/velero/templates/s3-snapshot-location.yaml delete mode 100644 charts/velero/templates/s3-volume-snapshot.yaml create mode 100644 utils/snapshots/nextcloud-main-snapshot.yaml create mode 100644 utils/snapshots/nextcloud-mariadb-snapshot.yaml diff --git a/charts/velero/templates/s3-backup.yaml b/charts/velero/templates/s3-backup-location.yaml similarity index 100% rename from charts/velero/templates/s3-backup.yaml rename to charts/velero/templates/s3-backup-location.yaml diff --git a/charts/velero/templates/s3-snapshot-location.yaml b/charts/velero/templates/s3-snapshot-location.yaml new file mode 100644 index 00000000..2bf71a19 --- /dev/null +++ b/charts/velero/templates/s3-snapshot-location.yaml @@ -0,0 +1,21 @@ +apiVersion: velero.io/v1 +kind: VolumeSnapshotLocation +metadata: + name: aws-default + namespace: velero +spec: + # Name of the volume snapshotter plugin to use to connect to this location. + # + # Required. + provider: velero.io/aws + + config: + # The AWS region where the volumes/snapshots are located. + # + # Required. + region: "eu-west-2" + + # AWS profile within the credentials file to use for the volume snapshot location. + # + # Optional (defaults to "default"). + profile: "default" diff --git a/charts/velero/templates/s3-volume-snapshot.yaml b/charts/velero/templates/s3-volume-snapshot.yaml deleted file mode 100644 index 31222698..00000000 --- a/charts/velero/templates/s3-volume-snapshot.yaml +++ /dev/null @@ -1,21 +0,0 @@ -#apiVersion: velero.io/v1 -#kind: VolumeSnapshotLocation -#metadata: -# name: ceph-block -# namespace: velero -#spec: -# # Name of the volume snapshotter plugin to use to connect to this location. -# # -# # Required. -# provider: velero.io/aws -# -# config: -# # The AWS region where the volumes/snapshots are located. -# # -# # Required. -# region: "eu-west-2" -# -# # AWS profile within the credentials file to use for the volume snapshot location. -# # -# # Optional (defaults to "default"). -# #profile: "default" diff --git a/charts/velero/templates/schedule-fs.yaml b/charts/velero/templates/schedule-fs.yaml index 080189c6..94e19c07 100644 --- a/charts/velero/templates/schedule-fs.yaml +++ b/charts/velero/templates/schedule-fs.yaml @@ -68,9 +68,12 @@ spec: # a persistent volume provider is configured for Velero. snapshotVolumes: null # Where to store the tarball and logs. + # THIS IS THE NAME OF A BackupStorageLocation CRD storageLocation: aws-default # The list of locations in which to store volume snapshots created for backups under this schedule. - volumeSnapshotLocations: [] + # THIS IS THE NAME OF A VolumeSnapshotLocation CRD + volumeSnapshotLocations: + - aws-default #- ceph-block #- gcp-primary # The amount of time before backups created on this schedule are eligible for garbage collection. If not specified, diff --git a/charts/velero/templates/schedule-rbd.yaml b/charts/velero/templates/schedule-rbd.yaml index 54b6a05a..79367dd9 100644 --- a/charts/velero/templates/schedule-rbd.yaml +++ b/charts/velero/templates/schedule-rbd.yaml @@ -70,7 +70,8 @@ spec: # Where to store the tarball and logs. storageLocation: aws-default # The list of locations in which to store volume snapshots created for backups under this schedule. - volumeSnapshotLocations: [] + volumeSnapshotLocations: + - aws-default #- ceph-block #- gcp-primary # The amount of time before backups created on this schedule are eligible for garbage collection. If not specified, diff --git a/charts/velero/templates/schedule-restic.yaml b/charts/velero/templates/schedule-restic.yaml index 5663bc93..74b7dd44 100644 --- a/charts/velero/templates/schedule-restic.yaml +++ b/charts/velero/templates/schedule-restic.yaml @@ -65,7 +65,7 @@ spec: storageLocation: aws-default # The list of locations in which to store volume snapshots created for backups under this schedule. volumeSnapshotLocations: - - aws-primary + - aws-default #- gcp-primary # The amount of time before backups created on this schedule are eligible for garbage collection. If not specified, # a default value of 30 days will be used. The default can be configured on the velero server diff --git a/utils/snapshots/nextcloud-main-snapshot.yaml b/utils/snapshots/nextcloud-main-snapshot.yaml new file mode 100644 index 00000000..7afcee56 --- /dev/null +++ b/utils/snapshots/nextcloud-main-snapshot.yaml @@ -0,0 +1,8 @@ +apiVersion: snapshot.storage.k8s.io/v1 +kind: VolumeSnapshot +metadata: + name: nextcloud-snapshot + namespace: nextcloud +spec: + source: + persistentVolumeClaimName: nextcloud-app-nextcloud diff --git a/utils/snapshots/nextcloud-mariadb-snapshot.yaml b/utils/snapshots/nextcloud-mariadb-snapshot.yaml new file mode 100644 index 00000000..113e9570 --- /dev/null +++ b/utils/snapshots/nextcloud-mariadb-snapshot.yaml @@ -0,0 +1,8 @@ +apiVersion: snapshot.storage.k8s.io/v1 +kind: VolumeSnapshot +metadata: + name: mariadb-snapshot + namespace: nextcloud +spec: + source: + persistentVolumeClaimName: data-nextcloud-app-mariadb-0