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

Add LiveMigrateIfPossible eviction strategy #9798

Merged
merged 3 commits into from
May 31, 2023

Conversation

rmohr
Copy link
Member

@rmohr rmohr commented May 25, 2023

What this PR does / why we need it:

Add a LiveMigrateIfPossible eviction strategy to the KubeVirt CR and VMIs. This strategy makes it easier to express an admin intent on the KubeVirt CR, that in general live-migrations are preferred, but if users do not explicitly request on VMs that they require a live-migration, non-migratable VMs would still just be stopped during evictions.

This solves the issue, that right now we would create for non-migratable VMIs a PodDisruptionBudget if the cluster-wide eviction strategy is LiveMigrate, leading to to the following two situations:

  1. Evictions may be blocked by such VMs indefinitely, where the user did not itself explicitly request migrations.
  2. We emit warning events, despite no explicit opt-in from the user that live migrations are a must.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #8555

Special notes for your reviewer:

Release note:

Add LiveMigrateIfPossible eviction strategy to allow admins to express a live migration preference instead of a live migration requirement for evictions.

@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/L labels May 25, 2023
@kubevirt-bot kubevirt-bot added the kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API label May 25, 2023
@rmohr
Copy link
Member Author

rmohr commented May 25, 2023

/cc @acardace

FYI

@rmohr rmohr marked this pull request as draft May 25, 2023 19:11
@kubevirt-bot kubevirt-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 25, 2023
@rmohr
Copy link
Member Author

rmohr commented May 25, 2023

/test all

@rmohr rmohr marked this pull request as ready for review May 26, 2023 08:16
@kubevirt-bot kubevirt-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 26, 2023
@rmohr
Copy link
Member Author

rmohr commented May 26, 2023

/cc @davidvossel

since you worked lately on an External eviction strategy.

@kubevirt-bot kubevirt-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 27, 2023
rmohr added 3 commits May 30, 2023 12:37
This strategy will only protect a VM with a PDB if the final
determination if a VM is migratable is true.
Further the eviction webhook will allow this VM to be evicted instead of
migrated in case that the VM is not migratable.

Signed-off-by: Roman Mohr <rmohr@google.com>
Signed-off-by: Roman Mohr <rmohr@google.com>
Signed-off-by: Roman Mohr <rmohr@google.com>
@kubevirt-bot kubevirt-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 30, 2023
@acardace
Copy link
Member

/lgtm
nice to see this!

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label May 30, 2023
@rmohr
Copy link
Member Author

rmohr commented May 30, 2023

/retest

Copy link
Member

@xpivarc xpivarc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xpivarc

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 31, 2023
@kubevirt-commenter-bot
Copy link

/retest-required
This bot automatically retries required jobs that failed/flaked on approved PRs.
Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@kubevirt-bot kubevirt-bot merged commit d82d678 into kubevirt:main May 31, 2023
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add LiveMigrateIfPossible eviction strategy
5 participants