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
The Operator modifies the ratio between the requests and limits that are set on developer containers. In conjunction with a per-project limit range that specifies limits and defaults, you can achieve the desired level of overcommit.
16
+
17
+
You must install the Cluster Resource Override Operator by using the {product-title} console or CLI as shown in the following sections. After you deploy the Cluster Resource Override Operator, the Operator modifies all new pods in specific namespaces. The Operator does not edit pods that existed before you deployed the Operator.
18
+
13
19
During the installation, you create a `ClusterResourceOverride` custom resource (CR), where you set the level of overcommit, as shown in the
14
20
following example:
15
21
@@ -39,8 +45,7 @@ been set on containers. Create a `LimitRange` object with default limits per ind
39
45
or configure limits in `Pod` specs for the overrides to apply.
40
46
====
41
47
42
-
When configured, overrides can be enabled per-project by applying the following
43
-
label to the Namespace object for each project:
48
+
When configured, you can enable overrides on a per-project basis by applying the following label to the `Namespace` object for each project where you want the overrides to apply. For example, you can configure override so that infrastructure components are not subject to the overrides.
44
49
45
50
[source,yaml]
46
51
----
@@ -57,3 +62,53 @@ metadata:
57
62
----
58
63
59
64
The Operator watches for the `ClusterResourceOverride` CR and ensures that the `ClusterResourceOverride` admission webhook is installed into the same namespace as the operator.
65
+
66
+
// Examples take from: https://github.com/openshift/cluster-resource-override-admission-operator?tab=readme-ov-file#test-pod-resource-override
67
+
For example, a pod has the following resources limits:
68
+
69
+
[source,yaml]
70
+
----
71
+
apiVersion: v1
72
+
kind: Pod
73
+
metadata:
74
+
name: my-pod
75
+
namespace: my-namespace
76
+
# ...
77
+
spec:
78
+
containers:
79
+
- name: hello-openshift
80
+
image: openshift/hello-openshift
81
+
resources:
82
+
limits:
83
+
memory: "512Mi"
84
+
cpu: "2000m"
85
+
# ...
86
+
----
87
+
88
+
The Cluster Resource Override Operator intercepts the original pod request, then overrides the resources according to the configuration set in the `ClusterResourceOverride` object.
89
+
90
+
[source,yaml]
91
+
----
92
+
apiVersion: v1
93
+
kind: Pod
94
+
metadata:
95
+
name: my-pod
96
+
namespace: my-namespace
97
+
# ...
98
+
spec:
99
+
containers:
100
+
- image: openshift/hello-openshift
101
+
name: hello-openshift
102
+
resources:
103
+
limits:
104
+
cpu: "1" <1>
105
+
memory: 512Mi
106
+
requests:
107
+
cpu: 250m <2>
108
+
memory: 256Mi
109
+
# ...
110
+
----
111
+
<1> The CPU limit has been overridden to `1` because the `limitCPUToMemoryPercent` parameter is set to `200` in the `ClusterResourceOverride` object. As such, 200% of the memory limit, 512Mi in CPU terms, is 1 CPU core.
112
+
<2> The CPU request is now `250m` because the `cpuRequestToLimit` is set to `25` in the `ClusterResourceOverride` object. As such, 25% of the 1 CPU core is 250m.
{product-title} administrators can control the level of overcommit and manage
24
-
container density on nodes. You can configure cluster-level overcommit using
25
-
the xref:#nodes-cluster-resource-override_nodes-cluster-overcommit[ClusterResourceOverride Operator]
26
-
to override the ratio between requests and limits set on developer containers.
27
-
In conjunction with xref:#nodes-cluster-node-overcommit_nodes-cluster-overcommit[node overcommit], you can adjust the resource limit and request to achieve the desired level of overcommit.
24
+
container density on developer containers by using
25
+
the xref:#nodes-cluster-resource-override_nodes-cluster-overcommit[ClusterResourceOverride Operator].
0 commit comments