Skip to content

Commit e429c1d

Browse files
authored
Merge pull request #73550 from ShaunaDiaz/OCPBUGS-31055
OCPBUGS#31055: fix table, optimize module ephemeral storage mgmt
2 parents 4d30913 + 2de8740 commit e429c1d

File tree

2 files changed

+47
-10
lines changed

2 files changed

+47
-10
lines changed

microshift_storage/microshift-storage-migration.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[id="microshift-storage-migration"]
33
= Storage migration using the Kube Storage Version Migrator
44
include::_attributes/attributes-microshift.adoc[]
5-
:context: microshift-storage-plugin-overview
5+
:context: microshift-storage-migration
66

77
toc::[]
88

modules/storage-ephemeral-storage-manage.adoc

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Module included in the following assemblies:
22
//
3-
// storage/understanding-persistent-storage.adoc[leveloffset=+1]
3+
//* storage/understanding-persistent-storage.adoc
4+
//* storage/understanding-ephemeral-storage.adoc
45
//* microshift_storage/understanding-ephemeral-storage-microshift.adoc
5-
// storage/understanding-ephemeral-storage.adoc
66

77
[id=storage-ephemeral-storage-manage_{context}]
88
= Ephemeral storage management
@@ -14,10 +14,28 @@ You can manage local ephemeral storage by specifying requests and limits. Each c
1414
* `spec.containers[].resources.limits.ephemeral-storage`
1515
* `spec.containers[].resources.requests.ephemeral-storage`
1616

17-
Limits and requests for ephemeral storage are measured in byte quantities. You can express storage as a plain integer or as a fixed-point number using one of these suffixes: E, P, T, G, M, k. You can also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki. For example, the following quantities all represent approximately the same value: 128974848, 129e6, 129M, and 123Mi. The case of the suffixes is significant. If you specify 400m of ephemeral storage, this requests 0.4 bytes, rather than 400 mebibytes (400Mi) or 400 megabytes (400M), which was probably what was intended.
17+
[id=storage-ephemeral-storage-limits-requests-units_{context}]
18+
== Ephemeral storage limits and requests units
19+
Limits and requests for ephemeral storage are measured in byte quantities. You can express storage as a plain integer or as a fixed-point number using one of these suffixes: E, P, T, G, M, k. You can also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki.
1820

19-
The following example shows a pod with two containers. Each container requests 2GiB of local ephemeral storage. Each container has a limit of 4GiB of local ephemeral storage. Therefore, the pod has a request of 4GiB of local ephemeral storage, and a limit of 8GiB of local ephemeral storage.
21+
For example, the following quantities all represent approximately the same value: 128974848, 129e6, 129M, and 123Mi.
2022

23+
[IMPORTANT]
24+
====
25+
The suffixes for each byte quantity are case-sensitive. Be sure to use the correct case. Use the case-sensitive "M", such as used in "400M" to set the request at 400 megabytes. Use the case-sensitive "400Mi" to request 400 mebibytes. If you specify "400m" of ephemeral storage, the storage requests is only 0.4 bytes.
26+
====
27+
28+
[id=storage-ephemeral-storage-requests-limits_{context}]
29+
== Ephemeral storage requests and limits example
30+
The following example configuration file shows a pod with two containers:
31+
32+
* Each container requests 2GiB of local ephemeral storage.
33+
* Each container has a limit of 4GiB of local ephemeral storage.
34+
* At the pod level, kubelet works out an overall pod storage limit by adding up the limits of all the containers in that pod.
35+
** In this case, the total storage usage at the pod level is the sum of the disk usage from all containers plus the pod's `emptyDir` volumes.
36+
** Therefore, the pod has a request of 4GiB of local ephemeral storage, and a limit of 8GiB of local ephemeral storage.
37+
38+
.Example ephemeral storage configuration with quotas and limits
2139
[source, yaml]
2240
----
2341
apiVersion: v1
@@ -40,17 +58,36 @@ spec:
4058
image: images.my-company.example/log-aggregator:v6
4159
resources:
4260
requests:
43-
ephemeral-storage: "2Gi" <1>
61+
ephemeral-storage: "2Gi"
62+
limits:
63+
ephemeral-storage: "4Gi"
4464
volumeMounts:
4565
- name: ephemeral
4666
mountPath: "/tmp"
4767
volumes:
4868
- name: ephemeral
4969
emptyDir: {}
5070
----
51-
<1> Request for local ephemeral storage.
52-
<2> Limit for local ephemeral storage.
71+
<1> Container request for local ephemeral storage.
72+
<2> Container limit for local ephemeral storage.
73+
74+
ifndef::microshift[]
75+
[id=storage-ephemeral-storage-scheduling-eviction_{context}]
76+
== Ephemeral storage configuration effects pod scheduling and eviction
77+
The settings in the pod spec affect both how the scheduler makes a decision about scheduling pods and when kubelet evicts pods.
78+
79+
* First, the scheduler ensures that the sum of the resource requests of the scheduled containers is less than the capacity of the node. In this case, the pod can be assigned to a node only if the node's available ephemeral storage (allocatable resource) is more than 4GiB.
80+
81+
* Second, at the container level, because the first container sets a resource limit, kubelet eviction manager measures the disk usage of this container and evicts the pod if the storage usage of the container exceeds its limit (4GiB). The kubelet eviction manager also marks the pod for eviction if the total usage exceeds the overall pod storage limit (8GiB).
82+
endif::microshift[]
5383

54-
This setting in the pod spec affects how the scheduler makes a decision on scheduling pods, and also how kubelet evict pods. First of all, the scheduler ensures that the sum of the resource requests of the scheduled containers is less than the capacity of the node. In this case, the pod can be assigned to a node only if its available ephemeral storage (allocatable resource) is more than 4GiB.
84+
ifdef::microshift[]
85+
[id=storage-ephemeral-storage-eviction_{context}]
86+
== Ephemeral storage configuration effects pod eviction
87+
The settings in the pod spec affect when kubelet evicts pods. At the container level, because the first container sets a resource limit, kubelet eviction manager measures the disk usage of this container and evicts the pod if the storage usage of the container exceeds its limit (4GiB). The kubelet eviction manager also marks the pod for eviction if the total usage exceeds the overall pod storage limit (8GiB).
5588

56-
Secondly, at the container level, since the first container sets resource limit, kubelet eviction manager measures the disk usage of this container and evicts the pod if the storage usage of this container exceeds its limit (4GiB). At the pod level, kubelet works out an overall pod storage limit by adding up the limits of all the containers in that pod. In this case, the total storage usage at the pod level is the sum of the disk usage from all containers plus the pod's `emptyDir` volumes. If this total usage exceeds the overall pod storage limit (4GiB), then the kubelet also marks the pod for eviction.
89+
[NOTE]
90+
====
91+
This policy is strictly for `emptyDir` volumes and is not applied to persistent storage. You can specify the `priorityClass` of pods to exempt the pod from eviction.
92+
====
93+
endif::microshift[]

0 commit comments

Comments
 (0)