5.9.3. Configuring cluster-level overcommit
You can use the OpenShift CLI to configure the Cluster Resource Override Operator to help control overcommit in your cluster.
The Cluster Resource Override Operator requires a ClusterResourceOverride custom resource (CR) and a label for each project where you want the Operator to control overcommit.
By default, the installation process creates two Cluster Resource Override pods on the control plane nodes in the clusterresourceoverride-operator namespace. You can move these pods to other nodes, such as infrastructure nodes, as needed. Infrastructure nodes are not counted toward the total number of subscriptions that are required to run the environment. For more information, see "Moving the Cluster Resource Override Operator pods".
Prerequisites
-
The Cluster Resource Override Operator has no effect if limits have not been set on containers. You must specify default limits for a project using a
LimitRangeobject or configure limits inPodspecs for the overrides to apply.
Procedure
Edit the
ClusterResourceOverrideCR:apiVersion: operator.autoscaling.openshift.io/v1 kind: ClusterResourceOverride metadata: name: cluster spec: podResourceOverride: spec: memoryRequestToLimitPercent: 50 cpuRequestToLimitPercent: 25 limitCPUToMemoryPercent: 200 # ...where:
spec.podResourceOverride.spec.memoryRequestToLimitPercent-
Specifies the percentage to override the container memory limit, if used, between 1-100. The default is
50. This parameter is optional. spec.podResourceOverride.spec.cpuRequestToLimitPercent-
Specifies the percentage to override the container CPU limit, if used, between 1-100. The default is
25. This parameter is optional. spec.podResourceOverride.spec.limitCPUToMemoryPercent-
Specifies the percentage to override the container memory limit, if used. Scaling 1Gi of RAM at 100 percent is equal to 1 CPU core. This is processed before overriding the CPU request, if configured. The default is
200. This parameter is optional.
Ensure the following label has been added to the Namespace object for each project where you want the Cluster Resource Override Operator to control overcommit:
apiVersion: v1 kind: Namespace metadata: # ... labels: clusterresourceoverrides.admission.autoscaling.openshift.io/enabled: "true" # ...where:
metadata.labels.clusterresourceoverrides.admission.autoscaling.openshift.io/enabled: "true"- Specifies that you want to use the Cluster Resource Override Operator with this project.