| severity | Important |
|---|---|
| category | Performance |
| online version | https://github.com/Microsoft/PSRule.Rules.Kubernetes/blob/main/docs/rules/en/Kubernetes.Pod.Resources.md |
Set CPU and memory requirements for each container.
The default scheduler uses container compute resource configuration to select a node for scheduling the pod. If compute resources values are not provided, Kubernetes can't take these into account when making scheduling decisions.
Compute resources is not the only factor to determine pod placement. However, if the scheduler places a pod on a host with insufficient resources, pod performance may be impacted.
If the Kubernetes cluster uses resource quotas, pods that don't specify compute resources may be rejected.
Compute resources for a container are set within the pod specification by defining requests and limits.
Consider configuring CPU and memory resource requirements for each container.