From 9b7d04257e9752360c9c3010df5e648ca39ad440 Mon Sep 17 00:00:00 2001 From: Bart Geesink Date: Mon, 5 Jun 2023 21:49:24 +0200 Subject: [PATCH] add nfs storage for backup --- mysqlbackup/job.yml | 2 +- mysqlbackup/pv_nas.yml | 13 +++++++++++++ mysqlbackup/pvc_nas.yml | 12 ++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 mysqlbackup/pv_nas.yml create mode 100644 mysqlbackup/pvc_nas.yml diff --git a/mysqlbackup/job.yml b/mysqlbackup/job.yml index 1bcb2e6..6df59c2 100644 --- a/mysqlbackup/job.yml +++ b/mysqlbackup/job.yml @@ -31,7 +31,7 @@ spec: volumes: - name: backup-volume persistentVolumeClaim: - claimName: backup-pvc + claimName: nfs-mysqlbacup-claim - name: backup-script configMap: name: backup-script diff --git a/mysqlbackup/pv_nas.yml b/mysqlbackup/pv_nas.yml new file mode 100644 index 0000000..2e36c03 --- /dev/null +++ b/mysqlbackup/pv_nas.yml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: nfs-backup-mysql +spec: + capacity: + storage: 1Mi + accessModes: + - ReadWriteMany + nfs: + server: 192.168.86.86 + path: "/volume1/backupk8s/mysql/" + storageClassName: nfs diff --git a/mysqlbackup/pvc_nas.yml b/mysqlbackup/pvc_nas.yml new file mode 100644 index 0000000..d6984f7 --- /dev/null +++ b/mysqlbackup/pvc_nas.yml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: nfs-mysqlbacup-claim +spec: + accessModes: + - ReadWriteMany + storageClassName: "nfs" + resources: + requests: + storage: 1Mi +