Skip to content

Resource Filtering

Control which resources and paths are included in backups.

Exclude by Resource Name (Regex)

Exclude resources whose names match a pattern:

spec:
  namespacedResources:
    - resourceType: Deployment
      namespace: production
      name: webapp
  resourceFilter:
    excludeResourceNames:
      - "^debug-"
      - "^test-"
      - ".*-temp$"

Exclude by Label

Exclude resources with specific labels:

spec:
  resourceFilter:
    excludeResourceLabels:
      matchLabels:
        exclude-from-backup: "true"
    # Or match expressions
    excludeResourceLabels:
      matchExpressions:
        - key: environment
          operator: In
          values: [staging, dev]

Include by Label

Only back up resources with certain labels:

spec:
  resourceFilter:
    includeResourceLabels:
      matchLabels:
        backup: "true"

PV Path Filters

Back up only selected paths within a PVC:

spec:
  namespacedResources:
    - resourceType: Deployment
      namespace: production
      name: webapp
      pvFilters:
        - name: webapp-data
          include:
            - /data
            - /config
          exclude:
            - /data/cache
            - "*.log"

Filter Rules (Glob)

Use glob patterns for fine-grained control:

pvFilters:
  - name: webapp-data
    filterRules:
      - "+ /data/**"
      - "- /data/cache/**"
      - "- *.tmp"

Skip a PVC

Skip backing up a specific PVC:

pvFilters:
  - name: large-cache-pvc
    skip: true