kubevirt / containerized-data-importer

Data Import Service for kubernetes, designed with kubevirt in mind.
Apache License 2.0
427 stars 268 forks source link

Only create target PVC in other namespaces using upload populator #3462

Open mengkai514 opened 1 month ago

mengkai514 commented 1 month ago

What happened: When I use the upload populator to create a PVC in the 'mk' namespace, the populator controller only creates the target PVC, but it does not create 'prime-pvc' and 'prime-pvc-scratch', nor does it create a pod. However, it works normally in the 'default' namespace.

What you expected to happen: Create 'prime-pvc' 、 'prime-pvc-scratch' and 'upload-pod'.

How to reproduce it (as minimally and precisely as possible):

apiVersion: cdi.kubevirt.io/v1beta1 kind: VolumeUploadSource metadata: name: my-upload-source spec: contentType: kubevirt

apiVersion: v1 kind: PersistentVolumeClaim metadata: name: my-pvc-ns namespace: mk spec: dataSourceRef: apiGroup: cdi.kubevirt.io kind: VolumeUploadSource name: my-upload-source accessModes: ReadWriteMany resources: requests: storage: 1Gi storageClassName: managed-nfs-storage

Additional context: Add any other context about the problem here.

Environment:

aglitke commented 1 month ago

Thanks for your report. In order to understand what is happening in your cluster please provide the cdi-deployment log and the events / full yaml for the PVC in question.

mengkai514 commented 1 month ago

@aglitke The cdi-deployment log:

{"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.import-controller","msg":"reconciling Import PVCs","PVC":{"name":"my-pvc-ns","namespace":"mk"}} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.import-controller","msg":"PVC annotation not found, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"annotation":"cdi.kubevirt.io/storage.import.endpoint"} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.upload-controller","msg":"reconciling Upload PVCs","PVC":{"name":"my-pvc-ns","namespace":"mk"}} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.upload-controller","msg":"PVC not bound, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"Phase":"Pending"} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.clone-controller","msg":"reconciling Clone PVCs","PVC":{"name":"my-pvc-ns","namespace":"mk"}} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.clone-controller","msg":"PVC annotation not found, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"annotation":"k8s.io/CloneRequest"} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.clone-controller","msg":"PVC annotation not found, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"annotation":"k8s.io/CloneRequest"} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.clone-controller","msg":"PVC not bound, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"Phase":"Pending"} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.clone-controller","msg":"Should not reconcile this PVC","PVC":{"name":"my-pvc-ns","namespace":"mk"},"checkPVC(AnnCloneRequest)":false,"NOT has annotation(AnnCloneOf)":true,"isBound":false,"has finalizer?":false} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.upload-controller","msg":"not doing anything with PVC","PVC":{"name":"my-pvc-ns","namespace":"mk"},"isUpload":false,"isCloneTarget":false,"isBound":false,"podSucceededFromPVC":false,"deletionTimeStamp set?":false} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.import-controller","msg":"PVC annotation not found, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"annotation":"cdi.kubevirt.io/storage.import.source"} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.import-controller","msg":"PVC annotation not found, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"annotation":"cdi.kubevirt.io/storage.import.endpoint"} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.import-controller","msg":"PVC annotation not found, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"annotation":"cdi.kubevirt.io/storage.import.source"} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.import-controller","msg":"PVC not bound, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"Phase":"Pending"} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.upload-populator","msg":"reconciling Upload Source PVCs","PVC":{"name":"my-pvc-ns","namespace":"mk"}} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.import-controller","msg":"reconciling Import PVCs","PVC":{"name":"my-pvc-ns","namespace":"mk"}} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.import-controller","msg":"PVC annotation not found, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"annotation":"cdi.kubevirt.io/storage.import.endpoint"} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.import-controller","msg":"PVC annotation not found, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"annotation":"cdi.kubevirt.io/storage.import.source"} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.import-controller","msg":"PVC annotation not found, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"annotation":"cdi.kubevirt.io/storage.import.endpoint"} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.import-controller","msg":"PVC annotation not found, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"annotation":"cdi.kubevirt.io/storage.import.source"} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.import-controller","msg":"PVC not bound, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"Phase":"Pending"} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.upload-controller","msg":"reconciling Upload PVCs","PVC":{"name":"my-pvc-ns","namespace":"mk"}} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.upload-controller","msg":"PVC not bound, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"Phase":"Pending"} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.upload-controller","msg":"not doing anything with PVC","PVC":{"name":"my-pvc-ns","namespace":"mk"},"isUpload":false,"isCloneTarget":false,"isBound":false,"podSucceededFromPVC":false,"deletionTimeStamp set?":false} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.upload-populator","msg":"reconciling Upload Source PVCs","PVC":{"name":"my-pvc-ns","namespace":"mk"}} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.clone-controller","msg":"reconciling Clone PVCs","PVC":{"name":"my-pvc-ns","namespace":"mk"}} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.clone-controller","msg":"PVC annotation not found, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"annotation":"k8s.io/CloneRequest"} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.clone-controller","msg":"PVC annotation not found, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"annotation":"k8s.io/CloneRequest"} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.clone-controller","msg":"PVC not bound, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"Phase":"Pending"} {"level":"debug","ts":"2024-10-21T12:43:51Z","logger":"controller.clone-controller","msg":"Should not reconcile this PVC","PVC":{"name":"my-pvc-ns","namespace":"mk"},"checkPVC(AnnCloneRequest)":false,"NOT has annotation(AnnCloneOf)":true,"isBound":false,"has finalizer?":false} {"level":"debug","ts":"2024-10-21T12:43:58Z","logger":"controller.upload-populator","msg":"reconciling Upload Source PVCs","PVC":{"name":"my-pvc-ns","namespace":"mk"}} {"level":"debug","ts":"2024-10-21T12:43:58Z","logger":"controller.upload-controller","msg":"reconciling Upload PVCs","PVC":{"name":"my-pvc-ns","namespace":"mk"}} {"level":"debug","ts":"2024-10-21T12:43:58Z","logger":"controller.upload-controller","msg":"PVC not bound, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"Phase":"Pending"} {"level":"debug","ts":"2024-10-21T12:43:58Z","logger":"controller.upload-controller","msg":"not doing anything with PVC","PVC":{"name":"my-pvc-ns","namespace":"mk"},"isUpload":false,"isCloneTarget":false,"isBound":false,"podSucceededFromPVC":false,"deletionTimeStamp set?":false} {"level":"debug","ts":"2024-10-21T12:43:58Z","logger":"controller.clone-controller","msg":"reconciling Clone PVCs","PVC":{"name":"my-pvc-ns","namespace":"mk"}} {"level":"debug","ts":"2024-10-21T12:43:58Z","logger":"controller.clone-controller","msg":"PVC annotation not found, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"annotation":"k8s.io/CloneRequest"} {"level":"debug","ts":"2024-10-21T12:43:58Z","logger":"controller.clone-controller","msg":"PVC annotation not found, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"annotation":"k8s.io/CloneRequest"} {"level":"debug","ts":"2024-10-21T12:43:58Z","logger":"controller.clone-controller","msg":"PVC not bound, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"Phase":"Pending"} {"level":"debug","ts":"2024-10-21T12:43:58Z","logger":"controller.clone-controller","msg":"Should not reconcile this PVC","PVC":{"name":"my-pvc-ns","namespace":"mk"},"checkPVC(AnnCloneRequest)":false,"NOT has annotation(AnnCloneOf)":true,"isBound":false,"has finalizer?":false} {"level":"debug","ts":"2024-10-21T12:43:58Z","logger":"controller.import-controller","msg":"reconciling Import PVCs","PVC":{"name":"my-pvc-ns","namespace":"mk"}} {"level":"debug","ts":"2024-10-21T12:43:58Z","logger":"controller.import-controller","msg":"PVC annotation not found, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"annotation":"cdi.kubevirt.io/storage.import.endpoint"} {"level":"debug","ts":"2024-10-21T12:43:58Z","logger":"controller.import-controller","msg":"PVC annotation not found, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"annotation":"cdi.kubevirt.io/storage.import.source"} {"level":"debug","ts":"2024-10-21T12:43:58Z","logger":"controller.import-controller","msg":"PVC annotation not found, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"annotation":"cdi.kubevirt.io/storage.import.endpoint"} {"level":"debug","ts":"2024-10-21T12:43:58Z","logger":"controller.import-controller","msg":"PVC annotation not found, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"annotation":"cdi.kubevirt.io/storage.import.source"} {"level":"debug","ts":"2024-10-21T12:43:58Z","logger":"controller.import-controller","msg":"PVC not bound, skipping pvc","PVC":{"name":"my-pvc-ns","namespace":"mk"},"Phase":"Pending"}

The PVC yaml:

apiVersion: cdi.kubevirt.io/v1beta1 kind: VolumeUploadSource metadata: name: my-upload-source spec: contentType: kubevirt --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: my-pvc-ns namespace: mk spec: dataSourceRef: apiGroup: cdi.kubevirt.io kind: VolumeUploadSource name: my-upload-source accessModes: - ReadWriteOnce resources: requests: storage: 1Gi storageClassName: hostpath-csi