tarantool/tarantool-operator

Develop a tool for operating with backups

vanyarock01 opened this issue · 1 comments

The problem is that now you have to make a backup by hand:

for podname in $(kubectl -n $NS_NAME get pods -l tarantool.io/cluster-id=$CLUSTER_ID -o jsonpath="{range .items[*]}{.metadata.name}{''}{end}")
do 
    kubectl -n $NS_NAME exec -it ${podname} -- sh -c 'echo "box.backup.start()" | tarantoolctl connect /var/run/tarantool/*.control'
done

for podname in $(kubectl -n $NS_NAME get pods -l tarantool.io/cluster-id=$CLUSTER_ID -o jsonpath="{range .items[*]}{.metadata.name}{''}{end}")
do 
    kubectl -n $NS_NAME cp "${podname}":/var/lib/tarantool ${podname}
done

for podname in $(kubectl -n $NS_NAME get pods -l tarantool.io/cluster-id=$CLUSTER_ID -o jsonpath="{range .items[*]}{.metadata.name}{''}{end}")
do 
    kubectl -n $NS_NAME exec -it ${podname} -- sh -c 'echo "box.backup.stop()" | tarantoolctl connect /var/run/tarantool/*.control';
done

Possible (from the point of view of operation) approach:

  1. Request a backup of the cluster and get one archive with all pv contents + chart settings.
  2. On an empty cluster with the operator installed, send the archive for recovery and receive an identical working copy of the cluster.

Won't fix in CE