Pod memory requests are not showing as per the deployment yaml
Environment
- Red Hat OpenShift Container Platform (OCP) 4.x
Issue
- Pod yaml definition has resource request & limit for memory set as 1G, however when the pod is getting created the memory request is coming up as 400m
- Pod memory request does not match its deployment yaml
- Pod is created with less memory request than mentioned in its deployment yaml definition
Resolution
Refer to the Diagnostic Steps section and check If overcommitment is enabled on the namespace, you can disable overcommitment from the project to overcome the issue of overrides of resources by following the below step:
-
Edit the namespace and remove the label
clusterresourceoverrides.admission.autoscaling.openshift.io/enabled: "true"instead add the following label to disable the overrides for more details refer to the official docs for Disabling overcommitment for a project:$ oc edit ns/<namespace> [..] labels: quota.openshift.io/cluster-resource-override-enabled: "false" [..]
Root Cause
ClusterResourceOverride Operator or Vertical Pod Autoscaler Operator is the possible operator which can actually override the resource requests. for more details around these check the official docs for ClusterResourceOverride Operator Vertical Pod Autoscaler Operator
Diagnostic Steps
-
Check if ClusterResourceOverride Operator or Vertical Pod Autoscaler Operator are installed on the cluster.
$ oc get clusterresourceoverride cluster -n clusterresourceoverride-operator -o yaml $ oc get all -n openshift-vertical-pod-autoscaler -
Check and see if overcommitment is enabled on the namespace where you are facing issues. To confirm if the overcommitment is enabled on the namespace look for the below label on the namespace.
For Example:$ oc describe ns/<namespace> apiVersion: v1 kind: Namespace metadata: [..] labels: clusterresourceoverrides.admission.autoscaling.openshift.io/enabled: "true" [..]
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments