Skip to content

Commit ee82b46

Browse files
author
Lisa Pettyjohn
committed
OSDOCS-3786:Local ephemeral storage resource mgmt
1 parent 040a5f6 commit ee82b46

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

modules/storage-ephemeral-storage-manage.adoc

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,55 @@
22
//
33
// storage/understanding-persistent-storage.adoc[leveloffset=+1]
44
//* microshift_storage/understanding-ephemeral-storage-microshift.adoc
5-
5+
// storage/understanding-ephemeral-storage.adoc
66

77
[id=storage-ephemeral-storage-manage_{context}]
88
= Ephemeral storage management
99

1010
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.
11+
12+
You can manage local ephemeral storage by specifying requests and limits. Each container in a pod can specify the following:
13+
14+
* `spec.containers[].resources.limits.ephemeral-storage`
15+
* `spec.containers[].resources.requests.ephemeral-storage`
16+
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.
18+
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.
20+
21+
[source, yaml]
22+
----
23+
apiVersion: v1
24+
kind: Pod
25+
metadata:
26+
name: frontend
27+
spec:
28+
containers:
29+
- name: app
30+
image: images.my-company.example/app:v4
31+
resources:
32+
requests:
33+
ephemeral-storage: "2Gi" <1>
34+
limits:
35+
ephemeral-storage: "4Gi" <2>
36+
volumeMounts:
37+
- name: ephemeral
38+
mountPath: "/tmp"
39+
- name: log-aggregator
40+
image: images.my-company.example/log-aggregator:v6
41+
resources:
42+
requests:
43+
ephemeral-storage: "2Gi" <1>
44+
volumeMounts:
45+
- name: ephemeral
46+
mountPath: "/tmp"
47+
volumes:
48+
- name: ephemeral
49+
emptyDir: {}
50+
----
51+
<1> Request for local ephemeral storage.
52+
<2> Limit for local ephemeral storage.
53+
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.
55+
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.

storage/understanding-ephemeral-storage.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ include::modules/storage-ephemeral-storage-types.adoc[leveloffset=+1]
1212

1313
include::modules/storage-ephemeral-storage-manage.adoc[leveloffset=+1]
1414

15+
For information about defining quotas for projects, see xref:../applications/quotas/quotas-setting-per-project.adoc[Quota setting per project].
16+
1517
include::modules/storage-ephemeral-storage-monitoring.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)