You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/k8s-best-practices-requests-limits.adoc
+13-3Lines changed: 13 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ Kubernetes provides mechanisms for defining resource usage per container:
6
6
* *Limits*: The maximum amount a container is allowed to consume. Enforced by the kubelet.
7
7
* *Quotas*: Enforce aggregate resource usage at the namespace/project level to prevent resource overuse.
8
8
9
-
See: _OpenShift Resource Quotas Per Project_
9
+
See: link:https://docs.openshift.com/container-platform/latest/nodes/clusters/nodes-cluster-resource-configure.html#nodes-cluster-resource-configure-resource-quotas_nodes-cluster-resource-configure[OpenShift Resource Quotas Per Project]
10
10
11
11
== Risks with Resource Limits
12
12
@@ -59,11 +59,21 @@ Kubernetes treats resources differently depending on their behavior under pressu
59
59
* *Compressible (e.g., CPU)*: Requests should be balanced to ensure proportional system behavior and fairness.
60
60
* *Incompressible (e.g., memory)*: Requests should reflect minimum safe usage to avoid runtime failure.
61
61
62
-
See: _More details on setting requests for different resource types_
62
+
See: link:https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes[More details on setting requests for different resource types]
63
63
64
64
== Alternatives to Resource Limits
65
65
66
66
Although limits are generally avoided for cluster components, the following mechanisms can help manage resources and prioritize workloads:
67
67
68
68
* *Pod Priority (PriorityClass)*: Preferred for ensuring essential core workloads have priority and sufficient resources.
69
-
** Allows critical components to avoid eviction during resource press**
69
+
** Allows critical components to avoid eviction during resource pressure.
70
+
** More effective than limits, as kubelet's eviction does not consider limits.
71
+
* *Quotas*: Can enforce requests and limits at the project level.
72
+
** Useful when guaranteed capacity is needed.
73
+
** Overcommitment trade-offs can be managed at the project, node, or cluster level.
74
+
75
+
== Overcommitment
76
+
77
+
Nodes can be overcommitted, influencing how requests and limits are applied.
78
+
79
+
* Overcommitted clusters often experience pod kills and kubelet restarts, degrading the product exp*
0 commit comments