根据资源过滤
格式为: resource.group, 如 storageclasses.storage.k8s.io
比如要排除以下资源:
- replicasets
- endpointslices.discovery.k8s.io
- endpoints
- events.events.k8s.io
- pods
- authconfigs.management.cattle.io
- clusterrepos.catalog.cattle.io
- clusters.management.cattle.io
- csinodes.storage.k8s.io
- features.management.cattle.io
- settings.management.cattle.io
命令如下:
velero backup create default-all \
--exclude-resources replicasets,endpointslices.discovery.k8s.io,endpoints,events.events.k8s.io,pods,authconfigs.management.cattle.io,clusterrepos.catalog.cattle.io,clusters.management.cattle.io,csinodes.storage.k8s.io,features.management.cattle.io,settings.management.cattle.io
根据 NameSpace 进行过滤
命令示例如下:
velero schedule create default-exclude-rancher-daily \
--schedule="@every 24h" \
--exclude-namespaces c-m-2hpl28vh,c-m-xgr56lxz,cattle-dashboards,cattle-fleet-clusters-system,cattle-fleet-local-system,cattle-fleet-system,cattle-global-data,cattle-global-nt,cattle-impersonation-system,cattle-resources-system,cattle-system,cluster-fleet-default-home-k3s-e7c0722dc658,cluster-fleet-default-multicloud-k3s-6c520ab37e6d,cluster-fleet-local-local-1a3d67d0a899,fleet-default,fleet-local,local,p-67tgc,p-6bnxt,p-dj2vc,p-k77t2,p-lzt79,p-qrjhz,p-zlf9l,p-zpwst,user-5rvgp
执行定期备份
如上, 命令如下:
velero schedule create default-exclude-rancher-daily \
--schedule="@every 24h"