Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kale-amruta committed Aug 22, 2022
1 parent 5a33833 commit 78fdb1c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ actions:
- func: KubeTask
name: takeSnapshot
args:
image: ghcr.io/kanisterio/kanister-kubectl-1.18:0.80.0
image: ghcr.io/kanisterio/kanister-kubectl-1.18:0.81.0
command:
- sh
- -o
Expand All @@ -34,7 +34,7 @@ actions:
- func: KubeTask
name: uploadSnapshot
args:
image: ghcr.io/kanisterio/kanister-kubectl-1.18:0.80.0
image: ghcr.io/kanisterio/kanister-kubectl-1.18:0.81.0
command:
- sh
- -o
Expand All @@ -50,7 +50,7 @@ actions:
- func: KubeTask
name: removeSnapshot
args:
image: ghcr.io/kanisterio/kanister-kubectl-1.18:0.80.0
image: ghcr.io/kanisterio/kanister-kubectl-1.18:0.81.0
command:
- sh
- -o
Expand All @@ -61,13 +61,19 @@ actions:
- |
kubectl exec -it -n {{ .Phases.takeSnapshot.Output.etcdNS }} "{{ .Phases.takeSnapshot.Output.etcdPod }}" -c etcd -- sh -c "rm -rf /tmp/etcd-backup.db"
restore:
# This phase is not actualy performing restore of the etc backup but is used
# to copy backup data. It spins a pod on a master node having label `etcd-backup`.
# The pod is used to download the backup data from the object store
# and copy it to the /mnt/data location of the pv mapped to pvc `pvc-claim-etcd`.
# The pv created mounts to the host path /mnt/data on master node where the cluster-ocp-restore
# script would be executed.
inputArtifactNames:
- etcdBackup
phases:
- func: PrepareData
name: restoreFromObjectStore
args:
image: "ghcr.io/kanisterio/kanister-tools:0.80.0"
image: "ghcr.io/kanisterio/kanister-tools:0.81.0"
namespace: "{{ .Object.metadata.namespace }}"
podOverride:
nodeSelector:
Expand All @@ -81,7 +87,7 @@ actions:
securityContext:
privileged: true
volumes:
pvc-claim-2: "/mnt/data"
pvc-claim-etcd: "/mnt/data"
command:
- bash
- -o
Expand All @@ -102,7 +108,7 @@ actions:
name: deleteFromObjectStore
args:
namespace: "{{ .Object.metadata.namespace }}"
image: "ghcr.io/kanisterio/kanister-tools:0.80.0"
image: "ghcr.io/kanisterio/kanister-tools:0.81.0"
command:
- bash
- -o
Expand Down
15 changes: 15 additions & 0 deletions examples/etcd/etcd-in-cluster/ocp/blueprint-v2/pv-etcd-backup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-volume-etcd
labels:
type: local
spec:
storageClassName: default
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/data"

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-claim-etcd
spec:
storageClassName: default
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi

0 comments on commit 78fdb1c

Please sign in to comment.