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
Keep the following in mind when you create a pod that is given a QoS class of `Guaranteed`:
9
+
You can create a pod with a quality of service (QoS) class of `Guaranteed` for high-performance workloads. Configuring a pod with a QoS class of `Guaranteed` ensures that the pod has priority access to the specified CPU and memory resources.
10
10
11
-
* Every container in the pod must have a memory limit and a memory request, and they must be the same.
12
-
* Every container in the pod must have a CPU limit and a CPU request, and they must be the same.
11
+
To create a pod with QoS class of `Guaranteed`, you must apply the following specifications:
13
12
14
-
The following example shows the configuration file for a pod that has one container. The container has a memory limit and a memory request, both equal to 200 MiB. The container has a CPU limit and a CPU request, both equal to 1 CPU.
13
+
* Set identical values for the memory limit and memory request fields for each container in the pod.
14
+
* Set identical values for CPU limit and CPU request fields for each container in the pod.
15
15
16
+
[NOTE]
17
+
====
18
+
A pod with a QoS class of `Guaranteed` cannot use resources beyond the specified limits.
19
+
====
20
+
21
+
The pod will not be evicted from a node unless one of the following criteria is met:
22
+
23
+
* During resource contention on a node, there are no lower-priority pods that can be evicted.
24
+
* The pod exceeds the CPU or memory limits.
25
+
26
+
.Prerequisites
27
+
28
+
* Access to the cluster as a user with the `cluster-admin` role.
29
+
30
+
* The OpenShift CLI (`oc`) installed.
31
+
32
+
.Procedure
33
+
34
+
. Create a namespace for the pod by running the following command:
35
+
+
36
+
[source,terminal]
37
+
----
38
+
$ oc create namespace qos-example <1>
39
+
----
40
+
<1> This example uses the `qos-example` namespace.
41
+
+
42
+
.Example output
43
+
[source,terminal]
44
+
----
45
+
namespace/qos-example created
46
+
----
47
+
48
+
. Create the `Pod` resource:
49
+
50
+
.. Create a YAML file the defines the `Pod` resource:
<1> This example uses a public `hello-openshift` image. Replace with the image that you want to use for your workload.
82
+
<2> This example sets the memory limit to 200MB.
83
+
<3> This example sets the CPU limit to one CPU.
84
+
<4> This example sets the memory request to 200MB.
85
+
<5> This example sets the CPU request to one CPU.
86
+
+
87
+
[NOTE]
88
+
====
89
+
If you specify a memory limit for a container, but do not specify a memory request, {product-title} automatically assigns a memory request that matches the limit. Similarly, if you specify a CPU limit for a container, but do not specify a CPU request, {product-title} automatically assigns a CPU request that matches the limit.
90
+
====
91
+
--
43
92
44
-
. Create the pod:
93
+
.. Create the `Pod` resource by running the following command:
* View the `qosClass` value for the pod by running the following command:
52
109
+
53
110
[source,terminal]
54
111
----
55
-
$ oc get pod qos-demo --namespace=qos-example --output=yaml
112
+
$ oc get pod qos-demo --namespace=qos-example --output=yaml | grep qosClass
56
113
----
57
114
+
58
115
.Example output
59
116
[source,yaml]
60
117
----
61
-
spec:
62
-
containers:
63
-
...
64
-
status:
65
-
qosClass: Guaranteed
118
+
qosClass: Guaranteed
66
119
----
67
-
+
68
-
[NOTE]
69
-
====
70
-
If you specify a memory limit for a container, but do not specify a memory request, {product-title} automatically assigns a memory request that matches the limit. Similarly, if you specify a CPU limit for a container, but do not specify a CPU request, {product-title} automatically assigns a CPU request that matches the limit.
0 commit comments