Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filters by volume types #6482

Closed
Lyndon-Li opened this issue Jul 11, 2023 · 2 comments
Closed

Filters by volume types #6482

Lyndon-Li opened this issue Jul 11, 2023 · 2 comments

Comments

@Lyndon-Li
Copy link
Contributor

See issue #6450, sometimes, users want to filter volumes by volume types(i.e., configMap volumes, emptyDir volumes) from various backup types (i.e., file system backup, volume/CSI snapshot).
Looks like there is no existing way for uses to do this easily, if so, we may need to add this in Velero filter mechanisms.

@Lyndon-Li Lyndon-Li added 1.13-candidate issue/pr that should be considered to target v1.13 minor release Area/Filters labels Jul 11, 2023
@qiuming-best qiuming-best self-assigned this Aug 16, 2023
@reasonerjt
Copy link
Contributor

We may consider add a new condition in the volume policy to let user optionally skip hostPath, emptyDir by checking the keys of entries in .spec.volumes of pods.

@reasonerjt reasonerjt added this to the v1.13 milestone Sep 20, 2023
@reasonerjt reasonerjt removed the 1.13-candidate issue/pr that should be considered to target v1.13 minor release label Sep 20, 2023
@qiuming-best
Copy link
Contributor

qiuming-best commented Sep 22, 2023

Added one new field VolumeTypes string slice in volumeConditions struct

type volumeConditions struct {
	Capacity     string           `yaml:"capacity,omitempty"`
	StorageClass []string         `yaml:"storageClass,omitempty"`
	NFS          *nFSVolumeSource `yaml:"nfs,omitempty"`
	CSI          *csiVolumeSource `yaml:"csi,omitempty"`
	VolumeTypes  []string         `yaml:"volumeTypes,omitempty"`
}

below is an example showing that pod mounted PV with cinder or awsElasticBlockStore volume type should be selected and skipped to be backed up.

version: v1
volumePolicies:
- conditions:
    volumeTypes:
      - cinder
      - awsElasticBlockStore
  action:
    type: skip

below is one example of a backup of one pod with awsElasticBlockStore type of PV, and skipped being backed up.

time="2023-09-22T03:38:51Z" level=info msg="Summary for skipped PVs: [{\"name\":\"pvc-d3163b24-6b28-4a57-8419-c9bbb568fdd8\",\"reasons\":[{\"approach\":\"any\",\"reason\":\"skipped due to resource policy \"},{\"approach\":\"volumeSnapshot\",\"reason\":\"matched action is 'skip' in chosen resource policies\"}]}]" backup=velero/b6 logSource="pkg/backup/backup.go:434"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants