Describe the problem/challenge you have
Currently we create velero backup schedules using the velero cli.
However we have a use case involving managing schedules for large numbers of applications across many departments.
A simple, concise method for specifying backup schedules as configuration would be to provide a definition as a yaml file for velero to consume. This would work well with our current GitOps system of managing configurations.
Describe the solution you'd like
An option to provide backup schedule specifications as yaml definitions for velero cli to consume, or via the kubectl utility.
Anything else you would like to add:
n/a
Environment:
velero version): n/akubectl version): n/a/etc/os-release): n/a@archmangler you can definitely do this. See https://velero.io/docs/master/api-types/schedule/ for documentation.
You can also use velero schedule create .... -o yaml to generate a YAML manifest using the velero CLI (it won't be applied to the cluster if you use the -o yaml flag).
Closing this out per response, but feel free to reach out again as needed!
Sorry I know this issue is closed and I don't mean to necro this thread, but I am trying to solve the exact same problem and I can't see how to interface with the Velero API. Until now all I have done is use the Velero CLI and 'velero schedule create ~~~~'.
Would anyone (@archmangler, @skriss) be able to post an example of calling the Velero API to push a yaml definition and create a new schedule? Thanks for any help you can provide.
@craigvanaman since the Velero API is implemented via Kubernetes custom resource definitions, you would apply a Velero YAML resource definition the same way as any other Kubernetes resource -- so, if you have a schedule.yaml file with your desired schedule definition, you just need to kubectl apply -f schedule.yaml to create it.
Most helpful comment
@craigvanaman since the Velero API is implemented via Kubernetes custom resource definitions, you would apply a Velero YAML resource definition the same way as any other Kubernetes resource -- so, if you have a
schedule.yamlfile with your desired schedule definition, you just need tokubectl apply -f schedule.yamlto create it.