Skip to content

fix(vm): protect hp pod with new d8 label#2153

Merged
yaroslavborbat merged 1 commit into
mainfrom
fix/vm/protect-hotplug-pod
Mar 25, 2026
Merged

fix(vm): protect hp pod with new d8 label#2153
yaroslavborbat merged 1 commit into
mainfrom
fix/vm/protect-hotplug-pod

Conversation

@yaroslavborbat
Copy link
Copy Markdown
Member

@yaroslavborbat yaroslavborbat commented Mar 25, 2026

Description

Hotplug pods (HP) must not be evicted — this is enforced via a webhook.

Bug: HP pods were labeled with kubevirt.io=hotplug-disk, but the eviction webhook was checking for kubevirt.internal.virtualization.deckhouse.io=d8v-hotplug-disk. After renaming the label, the webhook was not updated, so eviction protection was not working. Fixed the label mismatch in the webhook and added an e2e test to cover this case.

deckhouse/3p-kubevirt#83

Why do we need it, and what problem does it solve?

HP pods labeled with the old kubevirt.io key were not matched by the eviction webhook after the label was renamed to kubevirt.internal.virtualization.deckhouse.io=d8v-hotplug-disk. As a result, HP pods could be evicted unexpectedly, potentially disrupting hotplugged disk attachments.

What is the expected result?

  1. Create a VM with a hotplugged disk.
  2. Attempt to evict the HP pod.
  3. Eviction is denied by the webhook.

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.
Screenshot From 2026-03-25 17-03-33

Changelog entries

section: vm
type: fix
summary: "Fixed virtual machine eviction during node drain: pods responsible for block device attachments are no longer removed from a cordoned node before virtual machine migration is complete."

Signed-off-by: Yaroslav Borbat <yaroslav.borbat@flant.com>
@yaroslavborbat yaroslavborbat force-pushed the fix/vm/protect-hotplug-pod branch from 2b19ec3 to 7398f23 Compare March 25, 2026 14:30
@yaroslavborbat yaroslavborbat merged commit 54e3c29 into main Mar 25, 2026
27 of 28 checks passed
@yaroslavborbat yaroslavborbat deleted the fix/vm/protect-hotplug-pod branch March 25, 2026 14:45
Isteb4k pushed a commit that referenced this pull request Mar 25, 2026
Signed-off-by: Yaroslav Borbat <yaroslav.borbat@flant.com>
(cherry picked from commit 54e3c29)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants