Skip to content

Commit 7110f36

Browse files
author
Lisa Pettyjohn
committed
OSDOCS-16945# CQA work Storage - understanding ephemeral storage
1 parent 92f4809 commit 7110f36

7 files changed

Lines changed: 146 additions & 22 deletions
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Module included in the following assemblies:
2+
//
3+
//* storage/understanding-persistent-storage.adoc
4+
//* storage/understanding-ephemeral-storage.adoc
5+
//* microshift_storage/understanding-ephemeral-storage-microshift.adoc
6+
7+
:_mod-docs-content-type: CONCEPT
8+
[id=storage-ephemeral-storage-manage-config-and-eviction_{context}]
9+
= Ephemeral storage management configuration effects pod scheduling and eviction
10+
11+
[role="_abstract"]
12+
The settings in the pod spec affect both how the scheduler makes a decision about scheduling pods and when kubelet evicts pods.
13+
14+
ifndef::microshift[]
15+
16+
* 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.
17+
18+
* 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).
19+
endif::microshift[]
20+
21+
ifdef::microshift[]
22+
[id=storage-ephemeral-storage-eviction_{context}]
23+
.Ephemeral storage configuration effects pod eviction
24+
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).
25+
26+
[NOTE]
27+
====
28+
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.
29+
====
30+
endif::microshift[]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Module included in the following assemblies:
2+
//
3+
//* storage/understanding-persistent-storage.adoc
4+
//* storage/understanding-ephemeral-storage.adoc
5+
//* microshift_storage/understanding-ephemeral-storage-microshift.adoc
6+
7+
:_mod-docs-content-type: CONCEPT
8+
[id=storage-ephemeral-storage-manage-overview_{context}]
9+
= Ephemeral storage management overview
10+
11+
[role="_abstract"]
12+
Cluster administrators can manage ephemeral storage within a project by setting quotas that define the limit ranges and number of requests for ephemeral storage across all pods in a non-terminal state. Developers can also set requests and limits on this compute resource at the pod and container level.
13+
14+
You can manage local ephemeral storage by specifying requests and limits. Each container in a pod can specify the following:
15+
16+
* `spec.containers[].resources.limits.ephemeral-storage`
17+
* `spec.containers[].resources.requests.ephemeral-storage`
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// Module included in the following assemblies:
2+
//
3+
//* storage/understanding-persistent-storage.adoc
4+
//* storage/understanding-ephemeral-storage.adoc
5+
//* microshift_storage/understanding-ephemeral-storage-microshift.adoc
6+
7+
:_mod-docs-content-type: CONCEPT
8+
[id=storage-ephemeral-storage-manage-requests-and-limits_{context}]
9+
= Ephemeral storage management limits and requests
10+
11+
[role="_abstract"]
12+
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.
13+
14+
For example, the following quantities all represent approximately the same value: 128974848, 129e6, 129M, and 123Mi.
15+
16+
[IMPORTANT]
17+
====
18+
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 request is only 0.4 bytes.
19+
====
20+
21+
.Ephemeral storage requests and limits example
22+
The following example configuration file shows a pod with two containers:
23+
24+
* Each container requests 2GiB of local ephemeral storage.
25+
* Each container has a limit of 4GiB of local ephemeral storage.
26+
* At the pod level, kubelet works out an overall pod storage limit by adding up the limits of all the containers in that pod.
27+
** 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.
28+
** Therefore, the pod has a request of 4GiB of local ephemeral storage, and a limit of 8GiB of local ephemeral storage.
29+
30+
.Example ephemeral storage configuration with quotas and limits
31+
[source, yaml]
32+
----
33+
apiVersion: v1
34+
kind: Pod
35+
metadata:
36+
name: frontend
37+
spec:
38+
containers:
39+
- name: app
40+
image: images.my-company.example/app:v4
41+
resources:
42+
requests:
43+
ephemeral-storage: "2Gi"
44+
limits:
45+
ephemeral-storage: "4Gi"
46+
volumeMounts:
47+
- name: ephemeral
48+
mountPath: "/tmp"
49+
- name: log-aggregator
50+
image: images.my-company.example/log-aggregator:v6
51+
resources:
52+
requests:
53+
ephemeral-storage: "2Gi"
54+
limits:
55+
ephemeral-storage: "4Gi"
56+
volumeMounts:
57+
- name: ephemeral
58+
mountPath: "/tmp"
59+
volumes:
60+
- name: ephemeral
61+
emptyDir: {}
62+
----
63+
* `spec.containers.name.resources.requests.ephemeral-storage`: Container request for local ephemeral storage.
64+
* `spec.containers.name.resources.limits.ephemeral-storage`: Container limit for local ephemeral storage.
65+

modules/storage-ephemeral-storage-manage.adoc

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,26 @@ You can manage local ephemeral storage by specifying requests and limits. Each c
1717
* `spec.containers[].resources.requests.ephemeral-storage`
1818
1919
[id=storage-ephemeral-storage-limits-requests-units_{context}]
20-
== Ephemeral storage limits and requests units
20+
Ephemeral storage limits and requests units::
2121
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.
22-
22+
+
2323
For example, the following quantities all represent approximately the same value: 128974848, 129e6, 129M, and 123Mi.
24-
24+
+
2525
[IMPORTANT]
2626
====
2727
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 request is only 0.4 bytes.
2828
====
2929

3030
[id=storage-ephemeral-storage-requests-limits_{context}]
31-
== Ephemeral storage requests and limits example
31+
Ephemeral storage requests and limits example::
3232
The following example configuration file shows a pod with two containers:
33-
33+
+
3434
* Each container requests 2GiB of local ephemeral storage.
3535
* Each container has a limit of 4GiB of local ephemeral storage.
3636
* At the pod level, kubelet works out an overall pod storage limit by adding up the limits of all the containers in that pod.
3737
** 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.
3838
** Therefore, the pod has a request of 4GiB of local ephemeral storage, and a limit of 8GiB of local ephemeral storage.
39-
39+
+
4040
.Example ephemeral storage configuration with quotas and limits
4141
[source, yaml]
4242
----
@@ -50,9 +50,9 @@ spec:
5050
image: images.my-company.example/app:v4
5151
resources:
5252
requests:
53-
ephemeral-storage: "2Gi" <1>
53+
ephemeral-storage: "2Gi"
5454
limits:
55-
ephemeral-storage: "4Gi" <2>
55+
ephemeral-storage: "4Gi"
5656
volumeMounts:
5757
- name: ephemeral
5858
mountPath: "/tmp"
@@ -70,24 +70,25 @@ spec:
7070
- name: ephemeral
7171
emptyDir: {}
7272
----
73-
<1> Container request for local ephemeral storage.
74-
<2> Container limit for local ephemeral storage.
73+
+
74+
* `spec.containers.resources.requests.ephemeral-storage`: Container request for local ephemeral storage.
75+
* `spec.containers.resources.limits.ephemeral-storage`: Container limit for local ephemeral storage.
7576
7677
ifndef::microshift[]
7778
[id=storage-ephemeral-storage-scheduling-eviction_{context}]
78-
== Ephemeral storage configuration effects pod scheduling and eviction
79+
Ephemeral storage configuration effects pod scheduling and eviction::
7980
The settings in the pod spec affect both how the scheduler makes a decision about scheduling pods and when kubelet evicts pods.
80-
81+
+
8182
* 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.
82-
83+
+
8384
* 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).
8485
endif::microshift[]
8586

8687
ifdef::microshift[]
8788
[id=storage-ephemeral-storage-eviction_{context}]
88-
== Ephemeral storage configuration effects pod eviction
89+
Ephemeral storage configuration effects pod eviction::
8990
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).
90-
91+
+
9192
[NOTE]
9293
====
9394
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.

modules/storage-ephemeral-storage-monitoring.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ To monitor ephemeral storage usage, use the `/bin/df` utility. By using this too
1212

1313
When you use the `df` command, the available space for only `/var/lib/kubelet` is shown if `/var/lib/containers` is placed on a separate disk by the cluster administrator.
1414

15+
You can use `/bin/df` as a tool to monitor ephemeral storage usage on the volume where ephemeral container data is located, which is `/var/lib/kubelet` and `/var/lib/containers`. The available space for only `/var/lib/kubelet` is shown when you use the `df` command if `/var/lib/containers` is placed on a separate disk by the cluster administrator.
16+
1517
.Procedure
1618

17-
* To show the human-readable values of used and available space in `/var/lib`, enter the following command:
19+
* To show the human-readable values of used and available space in `/var/lib`, run the following command:
1820
+
1921
[source,terminal]
2022
----

modules/storage-ephemeral-storage-types.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
[role="_abstract"]
1111
To provision ephemeral local storage, you can create the primary partition by using either root or runtime methods. This storage is always made available in the primary partition, providing temporary space for your workloads.
1212

13-
== Root
13+
Ephemeral local storage is always made available in the primary partition.
1414

15-
This partition holds the kubelet root directory, `/var/lib/kubelet/` by default, and `/var/log/` directory. This partition can be shared between user pods, the OS, and Kubernetes system daemons. This partition can be consumed by pods through `EmptyDir` volumes, container logs, image layers, and container-writable layers. Kubelet manages shared access and isolation of this partition. This partition is ephemeral, and applications cannot expect any performance SLAs, such as disk IOPS, from this partition.
15+
There are two basic ways of creating the primary partition:
1616

17-
== Runtime
17+
* *Root*: This partition holds the kubelet root directory, `/var/lib/kubelet/` by default, and `/var/log/` directory. This partition can be shared between user pods, the OS, and Kubernetes system daemons. This partition can be consumed by pods through `EmptyDir` volumes, container logs, image layers, and container-writable layers. Kubelet manages shared access and isolation of this partition. This partition is ephemeral, and applications cannot expect any performance SLAs, such as disk IOPS, from this partition.
1818
19-
This is an optional partition that runtimes can use for overlay file systems. {product-title} attempts to identify and provide shared access along with isolation to this partition. Container image layers and writable layers are stored here. If the runtime partition exists, the `root` partition does not hold any image layer or other writable storage.
19+
* *Runtime*: This is an optional partition that runtimes can use for overlay file systems. {product-title} attempts to identify and provide shared access along with isolation to this partition. Container image layers and writable layers are stored here. If the runtime partition exists, the `root` partition does not hold any image layer or other writable storage.

storage/understanding-ephemeral-storage.adoc

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
:_mod-docs-content-type: ASSEMBLY
22
[id="understanding-ephemeral-storage"]
33
= Understanding ephemeral storage
4-
include::_attributes/common-attributes.adoc[]
4+
:toc:
5+
:toc-title:
56
:context: understanding-ephemeral-storage
7+
include::_attributes/common-attributes.adoc[]
8+
9+
[role="_abstract"]
10+
Pods and containers are ephemeral or transient in nature and designed for stateless applications. Ephemeral storage allows administrators and developers to better manage the local storage for some of their operations.
611

712
toc::[]
813

@@ -13,7 +18,11 @@ include::modules/storage-ephemeral-storage-overview.adoc[leveloffset=+1]
1318

1419
include::modules/storage-ephemeral-storage-types.adoc[leveloffset=+1]
1520

16-
include::modules/storage-ephemeral-storage-manage.adoc[leveloffset=+1]
21+
include::modules/storage-ephemeral-storage-manage-overview.adoc[leveloffset=+2]
22+
23+
include::modules/storage-ephemeral-storage-manage-config-and-eviction.adoc[leveloffset=+2]
24+
25+
include::modules/storage-ephemeral-storage-manage-requests-and-limits.adoc[leveloffset=+2]
1726

1827
ifndef::openshift-dedicated,openshift-rosa,openshift-rosa-hcp[]
1928
[id="additional-resources_{context}"]

0 commit comments

Comments
 (0)