Velero: Specify Velero Backup Schedules as YAML

Created on 6 Nov 2019  路  3Comments  路  Source: vmware-tanzu/velero

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 (use velero version): n/a
  • Kubernetes version (use kubectl version): n/a
  • Kubernetes installer & version: n/a
  • Cloud provider or hardware configuration: n/a
  • OS (e.g. from /etc/os-release): n/a
Question

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.yaml file with your desired schedule definition, you just need to kubectl apply -f schedule.yaml to create it.

All 3 comments

@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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Berndinox picture Berndinox  路  3Comments

Chams91 picture Chams91  路  4Comments

totemcaf picture totemcaf  路  4Comments

Berndinox picture Berndinox  路  3Comments

my1990 picture my1990  路  3Comments