Skip to content

Commit 1a8bd52

Browse files
authored
Merge pull request #39308 from sftim/20230306_pod_qos_tweaks
Tweak docs about QoS classes
2 parents d8e9c84 + fe1360f commit 1a8bd52

File tree

3 files changed

+44
-28
lines changed

3 files changed

+44
-28
lines changed

content/en/docs/concepts/workloads/pods/pod-qos.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Pod Quality of Service Classes
33
content_type: concept
4-
weight: 30
4+
weight: 85
55
---
66

77
<!-- overview -->

content/en/docs/reference/glossary/qos-class.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: QoS Class
33
id: qos-class
44
date: 2019-04-15
5-
full_link: /docs/concepts/workloads/pods/pod-quality/
5+
full_link: /docs/concepts/workloads/pods/pod-qos/
66
short_description: >
77
QoS Class (Quality of Service Class) provides a way for Kubernetes to classify pods within the cluster into several classes and make decisions about scheduling and eviction.
88

content/en/docs/tasks/configure-pod-container/quality-service-pod.md

Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,28 @@ weight: 30
88
<!-- overview -->
99

1010
This page shows how to configure Pods so that they will be assigned particular
11-
Quality of Service (QoS) classes. Kubernetes uses QoS classes to make decisions about evicting Pods when Node resources are exceeded.
11+
{{< glossary_tooltip text="Quality of Service (QoS) classes" term_id="qos-class" >}}.
12+
Kubernetes uses QoS classes to make decisions about evicting Pods when Node resources are exceeded.
1213

1314

15+
When Kubernetes creates a Pod it assigns one of these QoS classes to the Pod:
16+
17+
* [Guaranteed](/docs/concepts/workloads/pods/pod-qos/#guaranteed)
18+
* [Burstable](/docs/concepts/workloads/pods/pod-qos/#burstable)
19+
* [BestEffort](/docs/concepts/workloads/pods/pod-qos/#besteffort)
1420

1521

1622
## {{% heading "prerequisites" %}}
1723

1824

19-
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
25+
{{< include "task-tutorial-prereqs.md" >}}
2026

27+
You also need to be able to create and delete namespaces.
2128

2229

2330

2431
<!-- steps -->
2532

26-
## QoS classes
27-
28-
When Kubernetes creates a Pod it assigns one of these QoS classes to the Pod:
29-
30-
* Guaranteed
31-
* Burstable
32-
* BestEffort
3333

3434
## Create a namespace
3535

@@ -42,7 +42,7 @@ kubectl create namespace qos-example
4242

4343
## Create a Pod that gets assigned a QoS class of Guaranteed
4444

45-
For a Pod to be given a QoS class of Guaranteed:
45+
For a Pod to be given a QoS class of `Guaranteed`:
4646

4747
* Every Container in the Pod must have a memory limit and a memory request.
4848
* For every Container in the Pod, the memory limit must equal the memory request.
@@ -53,7 +53,7 @@ These restrictions apply to init containers and app containers equally.
5353
[Ephemeral containers](/docs/concepts/workloads/pods/ephemeral-containers/)
5454
cannot define resources so these restrictions do not apply.
5555

56-
Here is the configuration file for a Pod that has one Container. The Container has a memory limit and a
56+
Here is a manifest for a Pod that has one Container. The Container has a memory limit and a
5757
memory request, both equal to 200 MiB. The Container has a CPU limit and a CPU request, both equal to 700 milliCPU:
5858

5959
{{< codenew file="pods/qos/qos-pod.yaml" >}}
@@ -70,7 +70,7 @@ View detailed information about the Pod:
7070
kubectl get pod qos-demo --namespace=qos-example --output=yaml
7171
```
7272

73-
The output shows that Kubernetes gave the Pod a QoS class of Guaranteed. The output also
73+
The output shows that Kubernetes gave the Pod a QoS class of `Guaranteed`. The output also
7474
verifies that the Pod Container has a memory request that matches its memory limit, and it has
7575
a CPU request that matches its CPU limit.
7676

@@ -97,6 +97,9 @@ CPU limit, but does not specify a CPU request, Kubernetes automatically assigns
9797
the limit.
9898
{{< /note >}}
9999
100+
<!-- 4th level heading to suppress entry in nav -->
101+
#### Clean up {#clean-up-guaranteed}
102+
100103
Delete your Pod:
101104
102105
```shell
@@ -105,12 +108,12 @@ kubectl delete pod qos-demo --namespace=qos-example
105108

106109
## Create a Pod that gets assigned a QoS class of Burstable
107110

108-
A Pod is given a QoS class of Burstable if:
111+
A Pod is given a QoS class of `Burstable` if:
109112

110-
* The Pod does not meet the criteria for QoS class Guaranteed.
113+
* The Pod does not meet the criteria for QoS class `Guaranteed`.
111114
* At least one Container in the Pod has a memory or CPU request or limit.
112115

113-
Here is the configuration file for a Pod that has one Container. The Container has a memory limit of 200 MiB
116+
Here is a manifest for a Pod that has one Container. The Container has a memory limit of 200 MiB
114117
and a memory request of 100 MiB.
115118

116119
{{< codenew file="pods/qos/qos-pod-2.yaml" >}}
@@ -127,7 +130,7 @@ View detailed information about the Pod:
127130
kubectl get pod qos-demo-2 --namespace=qos-example --output=yaml
128131
```
129132

130-
The output shows that Kubernetes gave the Pod a QoS class of Burstable.
133+
The output shows that Kubernetes gave the Pod a QoS class of `Burstable`:
131134

132135
```yaml
133136
spec:
@@ -145,6 +148,9 @@ status:
145148
qosClass: Burstable
146149
```
147150
151+
<!-- 4th level heading to suppress entry in nav -->
152+
#### Clean up {#clean-up-burstable}
153+
148154
Delete your Pod:
149155
150156
```shell
@@ -153,10 +159,10 @@ kubectl delete pod qos-demo-2 --namespace=qos-example
153159

154160
## Create a Pod that gets assigned a QoS class of BestEffort
155161

156-
For a Pod to be given a QoS class of BestEffort, the Containers in the Pod must not
162+
For a Pod to be given a QoS class of `BestEffort`, the Containers in the Pod must not
157163
have any memory or CPU limits or requests.
158164

159-
Here is the configuration file for a Pod that has one Container. The Container has no memory or CPU
165+
Here is a manifest for a Pod that has one Container. The Container has no memory or CPU
160166
limits or requests:
161167

162168
{{< codenew file="pods/qos/qos-pod-3.yaml" >}}
@@ -173,7 +179,7 @@ View detailed information about the Pod:
173179
kubectl get pod qos-demo-3 --namespace=qos-example --output=yaml
174180
```
175181

176-
The output shows that Kubernetes gave the Pod a QoS class of BestEffort.
182+
The output shows that Kubernetes gave the Pod a QoS class of `BestEffort`:
177183

178184
```yaml
179185
spec:
@@ -185,6 +191,9 @@ status:
185191
qosClass: BestEffort
186192
```
187193
194+
<!-- 4th level heading to suppress entry in nav -->
195+
#### Clean up {#clean-up-besteffort}
196+
188197
Delete your Pod:
189198
190199
```shell
@@ -193,13 +202,13 @@ kubectl delete pod qos-demo-3 --namespace=qos-example
193202

194203
## Create a Pod that has two Containers
195204

196-
Here is the configuration file for a Pod that has two Containers. One container specifies a memory
205+
Here is a manifest for a Pod that has two Containers. One container specifies a memory
197206
request of 200 MiB. The other Container does not specify any requests or limits.
198207

199208
{{< codenew file="pods/qos/qos-pod-4.yaml" >}}
200209

201-
Notice that this Pod meets the criteria for QoS class Burstable. That is, it does not meet the
202-
criteria for QoS class Guaranteed, and one of its Containers has a memory request.
210+
Notice that this Pod meets the criteria for QoS class `Burstable`. That is, it does not meet the
211+
criteria for QoS class `Guaranteed`, and one of its Containers has a memory request.
203212

204213
Create the Pod:
205214

@@ -213,7 +222,7 @@ View detailed information about the Pod:
213222
kubectl get pod qos-demo-4 --namespace=qos-example --output=yaml
214223
```
215224

216-
The output shows that Kubernetes gave the Pod a QoS class of Burstable:
225+
The output shows that Kubernetes gave the Pod a QoS class of `Burstable`:
217226

218227
```yaml
219228
spec:
@@ -231,12 +240,19 @@ status:
231240
qosClass: Burstable
232241
```
233242
234-
Delete your Pod:
243+
## Retrieve the QoS class for a Pod
235244
236-
```shell
237-
kubectl delete pod qos-demo-4 --namespace=qos-example
245+
Rather than see all the fields, you can view just the field you need:
246+
247+
```bash
248+
kubectl --namespace=qos-example get pod qos-demo-4 -o jsonpath='{ .status.qosClass}{"\n"}'
238249
```
239250

251+
```none
252+
Burstable
253+
```
254+
255+
240256
## Clean up
241257

242258
Delete your namespace:

0 commit comments

Comments
 (0)