Skip to content

Commit 98910ac

Browse files
authored
Merge pull request #41805 from sabrinajess/CNV12571
CNV-12571: New content to enable descheduler on VMs
2 parents ce26f38 + f3541e1 commit 98910ac

File tree

5 files changed

+124
-1
lines changed

5 files changed

+124
-1
lines changed

_topic_maps/_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3073,6 +3073,8 @@ Topics:
30733073
File: virt-configuring-vgpu-passthrough
30743074
- Name: Configuring a watchdog device
30753075
File: virt-configuring-a-watchdog
3076+
- Name: Enabling descheduler evictions on virtual machines
3077+
File: virt-enabling-descheduler-evictions
30763078
# Importing virtual machines
30773079
- Name: Importing virtual machines
30783080
Dir: importing_vms

modules/nodes-descheduler-installing.adoc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
//
33
// * nodes/scheduling/nodes-descheduler.adoc
44

5+
ifeval::["{context}" == "nodes-descheduler"]
6+
:nodes:
7+
endif::[]
8+
9+
ifeval::["{context}" == "virt-enabling-descheduler-evictions"]
10+
:virt:
11+
endif::[]
12+
513
:_content-type: PROCEDURE
614
[id="nodes-descheduler-installing_{context}"]
715
= Installing the descheduler
@@ -35,6 +43,17 @@ endif::[]
3543
.. From the *Operators* -> *Installed Operators* page, click the *Kube Descheduler Operator*.
3644
.. Select the *Kube Descheduler* tab and click *Create KubeDescheduler*.
3745
.. Edit the settings as necessary.
46+
ifdef::virt[]
47+
... Expand the *Profiles* section and select `DevPreviewLongLifecycle`. The `AffinityAndTaints` profile is enabled by default.
48+
+
49+
[IMPORTANT]
50+
====
51+
The only profile currently available for {VirtProductName} is `DevPreviewLongLifecycle`.
52+
====
53+
54+
You can also configure the profiles and settings for the descheduler later using the OpenShift CLI (`oc`).
55+
endif::virt[]
56+
ifdef::nodes[]
3857
... Expand the *Profiles* section to select one or more profiles to enable. The `AffinityAndTaints` profile is enabled by default. Click *Add Profile* to select additional profiles.
3958
+
4059
[NOTE]
@@ -46,3 +65,12 @@ Do not enable both `TopologyAndDuplicates` and `SoftTopologyAndDuplicates`. Enab
4665
.. Click *Create*.
4766

4867
You can also configure the profiles and settings for the descheduler later using the OpenShift CLI (`oc`). If you did not adjust the profiles when creating the descheduler instance from the web console, the `AffinityAndTaints` profile is enabled by default.
68+
endif::nodes[]
69+
70+
ifeval::["{context}" == "nodes-descheduler"]
71+
:!nodes:
72+
endif::[]
73+
74+
ifeval::["{context}" == "virt-enabling-descheduler-evictions"]
75+
:!virt:
76+
endif::[]

modules/nodes-descheduler-profiles.adoc

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,18 @@
22
//
33
// * nodes/scheduling/nodes-descheduler.adoc
44

5+
ifeval::["{context}" == "nodes-descheduler"]
6+
:nodes:
7+
endif::[]
8+
9+
ifeval::["{context}" == "virt-enabling-descheduler-evictions"]
10+
:virt:
11+
endif::[]
12+
13+
:_content-type: REFERENCE
514
[id="nodes-descheduler-profiles_{context}"]
615
= Descheduler profiles
7-
16+
ifdef::nodes[]
817
The following descheduler profiles are available:
918

1019
`AffinityAndTaints`:: This profile evicts pods that violate inter-pod anti-affinity, node affinity, and node taints.
@@ -52,3 +61,22 @@ Do not enable both `SoftTopologyAndDuplicates` and `TopologyAndDuplicates`. Enab
5261
`EvictPodsWithLocalStorage`:: This profile allows pods with local storage to be eligible for eviction.
5362

5463
`EvictPodsWithPVC`:: This profile allows pods with persistent volume claims to be eligible for eviction.
64+
endif::nodes[]
65+
ifdef::virt[]
66+
Use the Technology Preview `DevPreviewLongLifecycle` profile to enable the descheduler on a virtual machine. This is the only descheduler profile currently available for {VirtProductName}. To ensure proper scheduling, create VMs with CPU and memory requests for the expected load.
67+
68+
`DevPreviewLongLifecycle`:: This profile balances resource usage between nodes and enables the following strategies:
69+
+
70+
* `RemovePodsHavingTooManyRestarts`: removes pods whose containers have been restarted too many times and pods where the sum of restarts over all containers (including Init Containers) is more than 100. Restarting the VM guest operating system does not increase this count.
71+
* `LowNodeUtilization`: evicts pods from overutilized nodes when there are any underutilized nodes. The destination node for the evicted pod will be determined by the scheduler.
72+
** A node is considered underutilized if its usage is below 20% for all thresholds (CPU, memory, and number of pods).
73+
** A node is considered overutilized if its usage is above 50% for any of the thresholds (CPU, memory, and number of pods).
74+
endif::virt[]
75+
76+
ifeval::["{context}" == "nodes-descheduler"]
77+
:!nodes:
78+
endif::[]
79+
80+
ifeval::["{context}" == "virt-enabling-descheduler-evictions"]
81+
:!virt:
82+
endif::[]
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Module included in the following assemblies:
2+
//
3+
// virt/virtual_machines/advanced_vm_management/virt-enabling-descheduler-evictions.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="virt-enabling-descheduler-evictions_{context}"]
7+
= Enabling descheduler evictions on a virtual machine (VM)
8+
9+
After the descheduler is installed, you can enable descheduler evictions on your VM by adding an annotation to the `VirtualMachine` custom resource (CR).
10+
11+
.Prerequisites
12+
13+
* Install the descheduler in the {product-title} web console or OpenShift CLI (`oc`).
14+
* Ensure that the VM is not running.
15+
16+
.Procedure
17+
18+
. Before starting the VM, add the `descheduler.alpha.kubernetes.io/evict` annotation to the `VirtualMachine` CR:
19+
+
20+
[source,yaml]
21+
----
22+
apiVersion: kubevirt.io/v1
23+
kind: VirtualMachine
24+
spec:
25+
template:
26+
metadata:
27+
annotations:
28+
descheduler.alpha.kubernetes.io/evict: "true"
29+
----
30+
31+
. If you did not already set the `DevPreviewLongLifecycle` profile in the web console during installation, specify the `DevPreviewLongLifecycle` in the `spec.profile` section of the `KubeDescheduler` object:
32+
+
33+
[source,yaml]
34+
----
35+
apiVersion: operator.openshift.io/v1
36+
kind: KubeDescheduler
37+
metadata:
38+
name: cluster
39+
namespace: openshift-kube-descheduler-operator
40+
spec:
41+
deschedulingIntervalSeconds: 3600
42+
profiles:
43+
- DevPreviewLongLifecycle
44+
----
45+
46+
The descheduler is now enabled on the VM.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
:_content-type: ASSEMBLY
2+
[id="virt-enabling-descheduler-evictions"]
3+
= Enabling descheduler evictions on virtual machines
4+
include::modules/virt-document-attributes.adoc[]
5+
include::modules/common-attributes.adoc[]
6+
:context: virt-enabling-descheduler-evictions
7+
8+
toc::[]
9+
10+
:FeatureName: Descheduler eviction for virtual machines
11+
include::snippets/technology-preview.adoc[]
12+
13+
The xref:../../../nodes/scheduling/nodes-descheduler.adoc#nodes-descheduler[descheduler] can be used to evict a running pod to allow the pod to be rescheduled onto a more suitable node. You must install the descheduler by using the {product-title} web console or OpenShift CLI (`oc`) before you can enable it on your virtual machine (VM).
14+
15+
include::modules/nodes-descheduler-profiles.adoc[leveloffset=+1]
16+
17+
include::modules/nodes-descheduler-installing.adoc[leveloffset=+1]
18+
19+
include::modules/virt-enabling-descheduler-evictions.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)