Open ncdc opened 6 years ago
As a good starting point, I created this snippet that helps set up annotation commands for you. Install fx and then run
kubectl get pods --all-namespaces -o json | fx 'l => l.items' 'i => i.reduce((acc, p) => {acc.push("kubectl -n " + p.metadata.namespace + " annotate pod/" + p.metadata.name + " backup.ark.heptio.com/backup-volumes=" + p.spec.volumes.map(v => v.name).join(",")); return acc;}, [])'
Which outputs the following structure
[
...
"kubectl -n redis annotate pod/redis-master-4 backup.ark.heptio.com/backup-volumes=redis-data,redis-conf,default-token-lqmpv"
...
]
It would be awesome if ark itself could help manage that out of the box and maybe take a selector as an argument. For example ark restic annotate -n mynamespace -l app=mongodb --all-volumes
I wrote a cli for this, just run python3 annotate.py namespace1 namespace2
https://github.com/zakkg3/podannotator
requires python3
It will annotate all pods with PVC in the given namespace(s).
I added this topic to our community meeting tomorrow (3/31): https://hackmd.io/Jq6F5zqZR7S80CeDWUklkA?both#March-31-2020.
The current mechanism to mark a volume for a restic backup is
It would be nice to make this easier with an
ark
subcommand. We should also make sure we can support various resources that contain pod specs (deployments, statefulsets, replicasets, jobs, replication controllers, pods themselves, ...)