Uploaded image for project: 'OpenShift API for Data Protection'
  1. OpenShift API for Data Protection
  2. OADP-4572

Namespace label selector not working for backups as expected

XMLWordPrintable

    • 4
    • False
    • Hide

      None

      Show
      None
    • False
    • ToDo
    • Important
    • 8
    • 2.000
    • Very Likely
    • 0
    • None
    • Unset
    • Unknown
    • None

      With OADP 1.4 it should be possible to do a namespace backup based on label assigned to the namespace:

      When we are saying 'namespace backup' we mean backup of the namespace content. Similarly as it works when using spec.includedNamespaces .

       

      But the result is that only the project and namespace objects are being backed up.

      # oc label namespace backuptest ns=roman
      kind: Backup
      apiVersion: velero.io/v1
      metadata:
        name: backup-ns2
        namespace: openshift-adp
      spec:
        volumeSnapshotLocations:
          - velero-sample-1
        defaultVolumesToFsBackup: true
        csiSnapshotTimeout: 10m0s
        ttl: 720h0m0s
        itemOperationTimeout: 4h0m0s
        storageLocation: velero-sample-1
        hooks: {}
        labelSelector:
          matchLabels:
            ns: roman
        snapshotMoveData: false

       

      $ velero describe backup backup-ns2 -n openshift-adp --details
      Name:         backup-ns2
      [...]
      Started:    2024-07-23 09:27:58 +0200 CEST
      Completed:  2024-07-23 09:28:02 +0200 CEST
      Expiration:  2024-08-22 09:27:58 +0200 CEST
      Total items to be backed up:  2
      Items backed up:              2
      Resource List:
        project.openshift.io/v1/Project:
          - backuptest
        v1/Namespace:
          - backuptest
      [...]
      

       

      When doing a backup of the same namespace but based on spec.includedNamespaces we are getting the complete backup:

       

      $ velero describe backup backup-ns1 -n openshift-adp --details
      Name:         backup-ns1
      [...]
      Started:    2024-07-23 09:17:23 +0200 CEST
      Completed:  2024-07-23 09:17:26 +0200 CEST
      Expiration:  2024-08-22 09:17:23 +0200 CEST
      Total items to be backed up:  23
      Items backed up:              23
      Resource List:
        authorization.openshift.io/v1/RoleBinding:
          - backuptest/admin
          - backuptest/system:deployers
          - backuptest/system:image-builders
          - backuptest/system:image-pullers
        rbac.authorization.k8s.io/v1/RoleBinding:
          - backuptest/admin
          - backuptest/system:deployers
          - backuptest/system:image-builders
          - backuptest/system:image-pullers
        v1/ConfigMap:
          - backuptest/kube-root-ca.crt
          - backuptest/openshift-service-ca.crt
        v1/Namespace:
          - backuptest
        v1/PersistentVolume:
          - pvc-572c76bd-25e8-41d6-a871-f7ef0da71720
        v1/PersistentVolumeClaim:
          - backuptest/sample-app-pvc
        v1/Pod:
          - backuptest/roman-sample-app
        v1/Secret:
          - backuptest/builder-dockercfg-wqzv6
          - backuptest/builder-token-4p8mh
          - backuptest/default-dockercfg-sx5qw
          - backuptest/default-token-b6slt
          - backuptest/deployer-dockercfg-q844m
          - backuptest/deployer-token-6f84z
        v1/ServiceAccount:
          - backuptest/builder
          - backuptest/default
          - backuptest/deployer
      [...]
      

       

       

              tkaovila@redhat.com Tiger Kaovilai
              rhn-support-rbobek Roman Bobek
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: