https://rancher.com/ logo
Title
h

hundreds-state-15112

11/03/2022, 10:28 PM
I’m trying to track progress of a rancher-backup based on the Backup k8s resource. Anyone know a kubectl command I can use to track the status? I would reference the rancher-backup pod but it’s always running and logs backups in addition to the restores. I just want to see when the restore has “completed”
I can do grep obviously, but I was hoping for something slightly more
kubectl
native if possible
c

creamy-pencil-82913

11/03/2022, 10:32 PM
I think it updates the status on the resource, have you looked at the full yaml of it to see if the information you need is in there?
h

hundreds-state-15112

11/03/2022, 10:32 PM
Yeah it is, I’m trying to get at it with some jsonpath business rn. Attempted --field-selector first but might be misunderstanding that
I’ll have to confirm whether the
conditions
field ever has
Completed
and
False
c

creamy-pencil-82913

11/03/2022, 10:36 PM
field selectors are like label selectors, but even more restricted in terms of what you can filter your list by. If you’re trying to print out a specific field from the resource then -o=jsonpath is probably what you want
👍 1
h

hundreds-state-15112

11/03/2022, 10:36 PM
Cool thanks for the assist, I think this’ll work
kubectl -n cattle-resources-system get restore your-restore-resource -o jsonpath='{.status.conditions[*].message}{"\n"}'

Completed