From eaadea56a6fe6e81da40cbeda909ce91419b7954 Mon Sep 17 00:00:00 2001 From: Kevin Hannon Date: Tue, 8 Oct 2024 11:18:31 -0400 Subject: [PATCH] [KEP-1967] - update docs for GA --- content/en/docs/concepts/storage/volumes.md | 30 ++++++++++++++----- .../size-memory-backed-volumes.md | 4 +++ 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/content/en/docs/concepts/storage/volumes.md b/content/en/docs/concepts/storage/volumes.md index 9d53608ab7..7a5d691628 100644 --- a/content/en/docs/concepts/storage/volumes.md +++ b/content/en/docs/concepts/storage/volumes.md @@ -242,19 +242,12 @@ the `emptyDir.medium` field to `"Memory"`, Kubernetes mounts a tmpfs (RAM-backed filesystem) for you instead. While tmpfs is very fast be aware that, unlike disks, files you write count against the memory limit of the container that wrote them. - A size limit can be specified for the default medium, which limits the capacity of the `emptyDir` volume. The storage is allocated from [node ephemeral storage](/docs/concepts/configuration/manage-resources-containers/#setting-requests-and-limits-for-local-ephemeral-storage). If that is filled up from another source (for example, log files or image overlays), the `emptyDir` may run out of capacity before this limit. - -{{< note >}} -You can specify a size for memory backed volumes, provided that the `SizeMemoryBackedVolumes` -[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) -is enabled in your cluster (this has been beta, and active by default, since the Kubernetes 1.22 release). -If you don't specify a volume size, memory backed volumes are sized to node allocatable memory. -{{< /note>}} +If no size is specified, memory backed volumes are sized to node allocatable memory. {{< caution >}} Please check [here](/docs/concepts/configuration/manage-resources-containers/#memory-backed-emptydir) @@ -281,6 +274,27 @@ spec: sizeLimit: 500Mi ``` +#### emptyDir memory configuration example + +```yaml +apiVersion: v1 +kind: Pod +metadata: + name: test-pd +spec: + containers: + - image: registry.k8s.io/test-webserver + name: test-container + volumeMounts: + - mountPath: /cache + name: cache-volume + volumes: + - name: cache-volume + emptyDir: + sizeLimit: 500Mi + medium: Memory +``` + ### fc (fibre channel) {#fc} An `fc` volume type allows an existing fibre channel block storage volume diff --git a/content/en/docs/reference/command-line-tools-reference/feature-gates/size-memory-backed-volumes.md b/content/en/docs/reference/command-line-tools-reference/feature-gates/size-memory-backed-volumes.md index ea6ea9a4c5..69162233c6 100644 --- a/content/en/docs/reference/command-line-tools-reference/feature-gates/size-memory-backed-volumes.md +++ b/content/en/docs/reference/command-line-tools-reference/feature-gates/size-memory-backed-volumes.md @@ -13,6 +13,10 @@ stages: - stage: beta defaultValue: true fromVersion: "1.22" + toVersion: "1.31" + - stage: stable + defaultValue: true + fromVersion: "1.32" --- Enable kubelets to determine the size limit for memory-backed volumes (mainly `emptyDir` volumes).