How to Modify the Metrics-Server Container Limits?

Problem

  • A metrics-server container running inside the metrics-server pod is frequently restarting because it's being OOMKilled due to insufficient resources.
  • Requests and Limits change applied to the metrics-server container reverts back.
  • How to modify the metrics-server container limits?

Environment

  • Private Cloud Director Kubernetes – v2025.4 and Higher
  • Self-Hosted Private Cloud Director Kubernetes - v2025.4 and Higher
  • Component - Metric Server Add-on.

Procedure

The metrics-server container running inside the metric-server pod retrieves its value from the metrics-server-nanny-config config map. This config map needs to be updated to push the latest configuration.

Direct update to the requests and limits for the metrics-server container running inside the metric-server pod won't work.

Updating the requests and limits for the metrics-server-nanny container running inside the metric-server pod will work without updating the Config Map.

  1. Take a backup of the existing metrics-server-nanny-config config map using the command given below:
Command
Copy
  1. Edit the Config Map.
Command
Copy
  1. Update the below fields with the desired value and save the config map.
Example
Copy

CPU and Memory calculations are done by the metrics-server-nanny container for the metrics-server container is based on the number of nodes running on the cluster.

CPU = baseCPU + extraCpu * max(nodes, minClusterSize)

Memory = baseMem + extraMemory * max(nodes, minClusterSize)

Here, CPU and Memory are the Limits that will be applied to the metric-server container. baseCPU, baseMem values can be retrieved from the existing metrics-server-nanny-config Config Map. However, values such as extraCpu(default is 1), extraMemory (default is 2) and minClusterSize (default is 10) can be retrieved from the metric-server cluster add-on, which are applicable only for Self-Hosted Private Cloud Director Kubernetes.

  1. Save the Config Map.
  2. Delete the metrics-server pod in the kube-system namespace and it should redeploy pod with new updated value as per updated config map.

Validation

  1. Validate the latest updated value in Config Map and Pod status.
Bash
Copy
  1. Latest Limits set to the metrics-server container running inside the metric-server pod.
  2. If these steps prove insufficient, reach out to the Platform9 Support Team for additional assistance.
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
Add-On