From 89a7cec5904afce5f3515303cdce48d9b21b0bea Mon Sep 17 00:00:00 2001 From: mikemcd3912 Date: Mon, 15 Apr 2024 22:50:02 +0000 Subject: [PATCH 1/2] Add restore --- .../snapshot-restore/claim.yaml | 16 ++++++++++++++++ .../restore-kustomization.yaml | 5 +++++ .../snapshot-restore/restore-test-pod.yaml | 18 ++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 eks-anywhere-vsphere/Testers/Core/snapshot-tester/snapshot-restore/claim.yaml create mode 100644 eks-anywhere-vsphere/Testers/Core/snapshot-tester/snapshot-restore/restore-kustomization.yaml create mode 100644 eks-anywhere-vsphere/Testers/Core/snapshot-tester/snapshot-restore/restore-test-pod.yaml diff --git a/eks-anywhere-vsphere/Testers/Core/snapshot-tester/snapshot-restore/claim.yaml b/eks-anywhere-vsphere/Testers/Core/snapshot-tester/snapshot-restore/claim.yaml new file mode 100644 index 00000000..9598fe0f --- /dev/null +++ b/eks-anywhere-vsphere/Testers/Core/snapshot-tester/snapshot-restore/claim.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: restored-vmware-csi-claim + namespace: default +spec: + accessModes: + - ReadWriteOnce + storageClassName: vmware-sc + resources: + requests: + storage: 4Gi + dataSource: + name: vmware-csi-volume-snapshot + kind: VolumeSnapshot + apiGroup: snapshot.storage.k8s.io \ No newline at end of file diff --git a/eks-anywhere-vsphere/Testers/Core/snapshot-tester/snapshot-restore/restore-kustomization.yaml b/eks-anywhere-vsphere/Testers/Core/snapshot-tester/snapshot-restore/restore-kustomization.yaml new file mode 100644 index 00000000..a788fcb1 --- /dev/null +++ b/eks-anywhere-vsphere/Testers/Core/snapshot-tester/snapshot-restore/restore-kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - claim.yaml + - restore-test-pod.yaml \ No newline at end of file diff --git a/eks-anywhere-vsphere/Testers/Core/snapshot-tester/snapshot-restore/restore-test-pod.yaml b/eks-anywhere-vsphere/Testers/Core/snapshot-tester/snapshot-restore/restore-test-pod.yaml new file mode 100644 index 00000000..027ab88d --- /dev/null +++ b/eks-anywhere-vsphere/Testers/Core/snapshot-tester/snapshot-restore/restore-test-pod.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Pod +metadata: + name: app-restore + namespace: default +spec: + containers: + - name: app + image: centos + command: ["/bin/sh"] + args: ["-c", "while true; do echo $(date -u) >> /data/out.txt; sleep 5; done"] + volumeMounts: + - name: persistent-storage + mountPath: /data + volumes: + - name: persistent-storage + persistentVolumeClaim: + claimName: restored-vmware-csi-claim \ No newline at end of file From 5b1c2e380cae230ad32b87fe371965bde1b20d1b Mon Sep 17 00:00:00 2001 From: mikemcd3912 Date: Tue, 16 Apr 2024 00:03:04 +0000 Subject: [PATCH 2/2] Kustomization modified --- .../snapshot-restore/restore-kustomization.yaml | 5 ----- .../snapshot-tester-kustomization.yaml | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) delete mode 100644 eks-anywhere-vsphere/Testers/Core/snapshot-tester/snapshot-restore/restore-kustomization.yaml diff --git a/eks-anywhere-vsphere/Testers/Core/snapshot-tester/snapshot-restore/restore-kustomization.yaml b/eks-anywhere-vsphere/Testers/Core/snapshot-tester/snapshot-restore/restore-kustomization.yaml deleted file mode 100644 index a788fcb1..00000000 --- a/eks-anywhere-vsphere/Testers/Core/snapshot-tester/snapshot-restore/restore-kustomization.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: - - claim.yaml - - restore-test-pod.yaml \ No newline at end of file diff --git a/eks-anywhere-vsphere/Testers/Core/snapshot-tester/snapshot-tester-kustomization.yaml b/eks-anywhere-vsphere/Testers/Core/snapshot-tester/snapshot-tester-kustomization.yaml index a67ba6cc..746c52c8 100644 --- a/eks-anywhere-vsphere/Testers/Core/snapshot-tester/snapshot-tester-kustomization.yaml +++ b/eks-anywhere-vsphere/Testers/Core/snapshot-tester/snapshot-tester-kustomization.yaml @@ -27,3 +27,19 @@ spec: namespace: flux-system interval: 1m0s prune: true +--- +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: snapshot-restore + namespace: flux-system +spec: + dependsOn: + - name: snapshot + path: "./eks-anywhere-vsphere/Testers/Core/snapshot-tester/snapshot-restore" + sourceRef: + kind: GitRepository + name: addons + namespace: flux-system + interval: 1m0s + prune: true