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

Propagate labels from the DVs to the importer pods #2894

Closed
liranr23 opened this issue Sep 11, 2023 · 10 comments
Closed

Propagate labels from the DVs to the importer pods #2894

liranr23 opened this issue Sep 11, 2023 · 10 comments

Comments

@liranr23
Copy link

liranr23 commented Sep 11, 2023

Is your feature request related to a problem? Please describe:
We wish to clean up the importer pods after the migration succeeds. For cold migrations it uses only single importer pod and we can get it by annotation in the PVC (cdi.kubevirt.io/storage.import.importPodName). But in case we do warm migration it uses more than one importer pod and PVC, the scratch ones.
We set labels on the DVs such as:

    migration: 61bb4fd7-ccb5-4584-8f23-ab519fa8b95a
    plan: caf900ea-ca79-4948-b76c-16567207f80a
    vmID: vm-710

That will make it easy to get the related importer pods based on that using label selector.

Describe the solution you'd like:
Labels that set in the DV will propagate to the importer pods.

Additional context:
More details in: kubev2v/forklift#588 (comment)

@akalenyu
Copy link
Collaborator

We had a similar issue recently with passing the priority class:
#2864

@aglitke
Copy link
Member

aglitke commented Sep 11, 2023

@liranr23 let us know if you think the approach in #2864 would work for your use case.

@liranr23
Copy link
Author

Yes, just for labeling so I don't think it needs to be allowed, just passed from the PVC (as the labels passed from the DV to the PVC)

Labels: map[string]string{
common.CDILabelKey: common.CDILabelValue,
common.CDIComponentLabel: common.ImporterPodName,
common.PrometheusLabelKey: common.PrometheusLabelValue,
},

@akalenyu
Copy link
Collaborator

Not sure I understand - do you suggest we pass labels from DV/PVC to importer pods?
If so, we discussed this in the sig-storage meeting this week, and IIUC that opens up a security concern
(Users that can't create pods with specific label can now exploit CDI to do it for them)

@liranr23
Copy link
Author

Not sure I understand - do you suggest we pass labels from DV/PVC to importer pods? If so, we discussed this in the sig-storage meeting this week, and IIUC that opens up a security concern (Users that can't create pods with specific label can now exploit CDI to do it for them)

Yes, that's what I suggest. If it raise security context maybe it can be limited to allowed ones? I think kubevirt already passing labels from resource to pod - e.g virt-launcher https://github.com/kubevirt/kubevirt/blob/main/pkg/virt-controller/services/template.go#L1403C11-L1403C11

@akalenyu
Copy link
Collaborator

If it raise security context maybe it can be limited to allowed ones?

Yeah, that's what we do with annotations

@kubevirt-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@kubevirt-bot kubevirt-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 13, 2023
@kubevirt-bot
Copy link
Contributor

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

/lifecycle rotten

@kubevirt-bot kubevirt-bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 12, 2024
@alromeros
Copy link
Collaborator

/remove-lifecycle rotten
Hey @liranr23, I think it's safe to close this since the main issue was addressed in kubev2v/forklift#588. wdyt?

@kubevirt-bot kubevirt-bot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Jan 16, 2024
@alromeros
Copy link
Collaborator

Closing this since the main issue seems to have been addressed. Feel free to reopen if necessary, thanks!

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

5 participants