The descheduler is not available by default. To enable the descheduler, you must install the Kube Descheduler Operator from OperatorHub and enable one or more descheduler profiles.
By default, the descheduler runs in predictive mode, which means that it only simulates pod evictions. You must change the mode to automatic for the descheduler to perform the pod evictions.
|
If you have enabled hosted control planes in your cluster, set a custom priority threshold to lower the chance that pods in the hosted control plane namespaces are evicted. Set the priority threshold class name to hypershift-control-plane , because it has the lowest priority value (100000000 ) of the hosted control plane priority classes.
|
Prerequisites
-
You are logged in to OKD as a user with the cluster-admin
role.
-
Access to the OKD web console.
-
Ensure that you have downloaded the pull secret from Red Hat OpenShift Cluster Manager as shown in Obtaining the installation program in the installation documentation for your platform.
If you have the pull secret, add the redhat-operators
catalog to the OperatorHub custom resource (CR) as shown in Configuring OKD to use Red Hat Operators.
Procedure
-
Log in to the OKD web console.
-
Create the required namespace for the Kube Descheduler Operator.
-
Navigate to Administration → Namespaces and click Create Namespace.
-
Enter openshift-kube-descheduler-operator
in the Name field, enter openshift.io/cluster-monitoring=true
in the Labels field to enable descheduler metrics, and click Create.
-
Install the Kube Descheduler Operator.
-
Navigate to Operators → OperatorHub.
-
Type Kube Descheduler Operator into the filter box.
-
Select the Kube Descheduler Operator and click Install.
-
On the Install Operator page, select A specific namespace on the cluster. Select openshift-kube-descheduler-operator from the drop-down menu.
-
Adjust the values for the Update Channel and Approval Strategy to the desired values.
-
Click Install.
-
Create a descheduler instance.
-
From the Operators → Installed Operators page, click the Kube Descheduler Operator.
-
Select the Kube Descheduler tab and click Create KubeDescheduler.
-
Edit the settings as necessary.
-
To evict pods instead of simulating the evictions, change the Mode field to Automatic.
-
Expand the Profiles section and select LongLifecycle
. The AffinityAndTaints
profile is enabled by default.
|
The only profile currently available for OKD Virtualization is LongLifecycle .
|
You can also configure the profiles and settings for the descheduler later using the OpenShift CLI (oc
).