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 a 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
+
In general, a pod with a QoS class of `Guaranteed` will not be evicted from a node. One exception is during resource contention caused by system daemons exceeding reserved resources. In this scenario, the `kubelet` might evict pods to preserve node stability, starting with the lowest priority pods.
17
+
18
+
.Prerequisites
19
+
20
+
* Access to the cluster as a user with the `cluster-admin` role
21
+
22
+
* The OpenShift CLI (`oc`)
23
+
24
+
.Procedure
25
+
26
+
. Create a namespace for the pod by running the following command:
27
+
+
28
+
[source,terminal]
29
+
----
30
+
$ oc create namespace qos-example <1>
31
+
----
32
+
<1> This example uses the `qos-example` namespace.
33
+
+
34
+
.Example output
35
+
[source,terminal]
36
+
----
37
+
namespace/qos-example created
38
+
----
39
+
40
+
. Create the `Pod` resource:
41
+
42
+
.. Create a YAML file that defines the `Pod` resource:
<1> This example uses a public `hello-openshift` image.
74
+
<2> Sets the memory limit to 200 MB.
75
+
<3> Sets the CPU limit to 1 CPU.
76
+
<4> Sets the memory request to 200 MB.
77
+
<5> Sets the CPU request to 1 CPU.
78
+
+
79
+
[NOTE]
80
+
====
81
+
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.
82
+
====
83
+
--
43
84
44
-
. Create the pod:
85
+
.. Create the `Pod` resource by running the following command:
* View the `qosClass` value for the pod by running the following command:
52
101
+
53
102
[source,terminal]
54
103
----
55
-
$ oc get pod qos-demo --namespace=qos-example --output=yaml
104
+
$ oc get pod qos-demo --namespace=qos-example --output=yaml | grep qosClass
56
105
----
57
106
+
58
107
.Example output
59
108
[source,yaml]
60
109
----
61
-
spec:
62
-
containers:
63
-
...
64
-
status:
65
-
qosClass: Guaranteed
110
+
qosClass: Guaranteed
66
111
----
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