kubevirt / cloud-provider-kubevirt

Kubernetes cloud-provider for KubeVirt
Apache License 2.0
73 stars 34 forks source link

Handle nodes with VMs that has set run strategy Once #243

Closed mfranczy closed 1 year ago

mfranczy commented 1 year ago

If VMs reach finalized phase and should remain stopped we should allow to delete the corresponding node objects as those will never leave the NotReady state.

kubevirt-bot commented 1 year ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please ask for approval from mfranczy by writing /assign @mfranczy in a comment. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/kubevirt/cloud-provider-kubevirt/blob/main/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
mfranczy commented 1 year ago

@davidvossel could you take a look and share your opinion? Once VMs reach finalized state and run strategy Once is set, IMO we should allow to delete the corresponding node objects.

My reasoning, VMI created on a different node will have a different IP address (if live migration is not supported) so a new node object should be initialized again by kubelet. It's problematic to reuse the old node object as it has set the old IP.

We should allow kubelet to create a new node object instead of using the old one.

mfranczy commented 1 year ago

/hold I am checking CCM discussion around similar problem. Maybe it should be solved in a different way.

mfranczy commented 1 year ago

Sorry for the noise, I was too fast with this PR. Even if a node won't leave NotReady state it still makes sense to keep it.