Skip to content

Windows pod is showing 20 GB free space when windows node has 200GB in EKS?

0

We have a windows node containing 200 GB total space. But when we are checking the same in windows pod it is showing only 20 GB free space.

We dont ahve any pvc or any type of storage mounted to the pod. We have created just a new sample hello-world windows pod and these are the commands we ran inside pod

fsutil volume diskfree C:

Get-PSDrive -PSProvider FileSystem

Name           Used (GB)     Free (GB) Provider      Root                                                                       CurrentLocation
----           ---------     --------- --------      ----                                                                       ---------------
C                   0.10         19.27 FileSystem    C:\

We have even hardcoded ephemeral-storage: "50Gi" in resource and limit of pod still showing 20 GB only.

Any suggestion please

1 Answer
2
Accepted Answer

The discrepancy in the available disk space on the Windows node (200GB) and the Windows pod (20GB) is likely due to the way Kubernetes manages container storage. Kubernetes uses a container runtime (such as Docker or containerd) to run containers, and these runtimes employ various storage management techniques.

In the case of Windows containers, the container runtime typically creates a thin provisioned disk (also known as a sparse disk or sparse file) for each container. This thin provisioned disk is a virtual disk file that starts small and grows dynamically as data is written to it, up to a specified maximum size.

The maximum size of the thin provisioned disk is determined by the ephemeral-storage limit specified in the container's resource requests or limits. In your case, even though you set ephemeral-storage: "50Gi", the actual disk space available to the container initially is much smaller (around 20GB).

Here's what's likely happening:

  1. When you create a Windows pod without any persistent volume claims (PVCs) or other storage mounts, Kubernetes creates a thin provisioned disk for the container's writable layer and ephemeral storage.

  2. The initial size of this thin provisioned disk is relatively small (e.g., 20GB), as it only needs to store the container's base image and any additional layers or changes made during runtime.

  3. As you write data to the container's filesystem, the thin provisioned disk will automatically grow in size, up to the specified ephemeral-storage limit of 50Gi (or the remaining available space on the node, whichever is smaller).

  4. The fsutil and Get-PSDrive commands you're running inside the container are showing the current used and free space on the thin provisioned disk, which initially starts at around 20GB free space.

To confirm this behavior, you can try writing a large file or directory structure inside the container until the available space approaches the ephemeral-storage limit you specified (50Gi or around 50GB).

This thin provisioning approach is a common storage management technique used by container runtimes to optimize disk space usage and enable efficient allocation of resources across multiple containers on the same node.

EXPERT
answered a year ago
EXPERT
reviewed 10 months ago
  • Thank you so much for the info.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.