Skip to content

NimTechnology

Trình bày các công nghệ CLOUD một cách dễ hiểu.

  • Kubernetes & Container
    • Docker
    • Kubernetes
      • Gateway API
      • Ingress
      • Pod
    • Helm Chart
    • OAuth2 Proxy
    • Isito-EnvoyFilter
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Vault
    • Longhorn – Storage
    • VictoriaMetrics
    • MetalLB
    • Kong Gateway
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Argo Events
    • Spinnaker
    • Jenkins
    • Harbor
    • TeamCity
    • Git
      • Bitbucket
  • Coding
    • DevSecOps
    • Terraform
      • GCP – Google Cloud
      • AWS – Amazon Web Service
      • Azure Cloud
    • Golang
    • Laravel
    • Python
    • Jquery & JavaScript
    • Selenium
  • Log, Monitor & Tracing
    • DataDog
    • Prometheus
    • Grafana
    • ELK
      • Kibana
      • Logstash
  • BareMetal
    • NextCloud
  • Toggle search form

[K8S] Windows pod disk size is insufficient.

Posted on November 20, 2025November 20, 2025 By nim No Comments on [K8S] Windows pod disk size is insufficient.

Nguyên nhân khiến pod Windows của bạn báo cáo kích thước ổ đĩa nhỏ (thường là 20GB) bất kể kích thước ổ đĩa thực tế của nút—là do cách Windows xử lý hệ thống tệp vùng chứa

The Key Difference

FeatureLinux PodsWindows Pods
Root FilesystemOverlayFS (Shared)Virtual Disk (Isolated)
Disk VisibilityUsually sees the Node’s full disk (unless limits are set).Sees a virtual limit (Sandbox) set by the runtime.
Default SizeSize of the underlying Node disk.20GB (Default hard limit per container).
Why?Files are stored as “diff” layers on the host filesystem.The container gets a virtual block device (.vhdx or similar) on the host.

Why it happens

Trên Linux, các container chia sẻ host’s filesystem trực tiếp qua overlay2. Nếu node của bạn có 100GB, thì container sẽ thấy 100GB.

Trên Windows, mỗi container được cấp phát một scratch space (khoảng không cục bộ) (sandbox) hoạt động như một đĩa ảo riêng biệt. Mặc định, Microsoft giới hạn điều này ở 20GB. Để ngăn một container làm đầy node. Ngay cả khi node EKS của bạn có ổ đĩa 500GB, pod Windows của bạn sẽ chỉ thấy C: là 20GB.

Contents

Toggle
  • How to fix it (Increase Windows Pod Disk)
    • Use emptyDir (Recommended)
    • Comparison
  • Check Free Space Inside the Pod
    • A. Check Free Space
    • Write a Large Test File
  • Understanding Insight
    • How it works (Math for your 100GB Node)
  • Summary Table

How to fix it (Increase Windows Pod Disk)

Bạn không thể “resize” ổ đĩa  C: của một container Windows đang chạy một cách động, nhưng bạn có hai lựa chọn chính để có thêm dung lượng:

Use emptyDir (Recommended)

Nếu bạn cần một temporary scratch space (e.g., for logs, builds, or processing), không ghi vào C:\. Thay vào đó, gắn một emptyDir volume. Điều này bỏ qua giới hạn gốc 20GB và sử dụng dung lượng thực tế khả dụng của node.storage.

apiVersion: v1
kind: Pod
metadata:
  name: windows-pod
spec:
  containers:
  - name: windows-container
    image: mcr.microsoft.com/windows/servercore:ltsc2019
    volumeMounts:
    - mountPath: C:\data
      name: scratch-volume
  volumes:
  - name: scratch-volume
    emptyDir: {}

Result: C:\data sẽ có kích thước bằng dung lượng đĩa trống của Node, trong khi C:\ giữ lại 20GB.

Dưới đây là 3 cách để viết emptyDir

1. Add a Size Limit (Best Practice)

Đây là phương án thay thế phổ biến nhất. Nó định nghĩa kích thước tối đa cho volume, giúp ngăn một pod duy nhất lấp đầy toàn bộ ổ đĩa Node.

  volumes:
  - name: scratch-volume
    emptyDir:
      sizeLimit: 50Gi

2. Only use emptyDir

volumes:
  - name: scratch-volume
    emptyDir: {}

3. Use RAM (Memory) instead of Disk

Nếu dữ liệu tạm thời của bạn nhỏ và cần rất nhanh, bạn có thể sử dụng RAM của node. Lưu ý: Điều này tính vào memory limit của container của bạn.

  volumes:
  - name: scratch-volume
    emptyDir:
      medium: "Memory"

Comparison

SyntaxMeaningLimit
emptyDir: {}Default disk storageLimit is Node capacity
emptyDir:
sizeLimit: 50Gi
Disk storage50GB (Pod evicted if exceeded)
emptyDir:
medium: "Memory"
RAM diskLimit is 50% of RAM (by default)

Check Free Space Inside the Pod

A. Check Free Space

sử dụng fsutil, công cụ hoạt động hoàn hảo cho các thư mục đã mount để xem không gian node cơ bản.

fsutil volume diskfree C:\data

Expected Output:

Bạn sẽ thấy toàn bộ dung lượng của Node ở đây, chứ không phải giới hạn 20GB.

Total # of free bytes        : 85899345920  (80 GB)
Total # of bytes             : 107374182400 (100 GB)
Total # of avail free bytes  : 85899345920

Nếu bạn chạy fsutil volume diskfree C:\, bạn có thể vẫn thấy giới hạn ~20GB.

Write a Large Test File

Try to write a dummy file larger than 20GB (or at least larger than the free space on C:) to C:\data.

# Create a 25GB test file in the emptyDir
fsutil file createnew C:\data\large-test.dat 26843545600
  • If it succeeds: You have successfully bypassed the container size limit.
  • If it fails: You are still writing to the container layer (check your mountPath).

Understanding Insight

It will not immediately take 20GB of your Node.

The 20GB (or whatever the default limit is) is a Thin Provisioned limit (Quota), not a pre-allocated reservation.

How it works (Math for your 100GB Node)

If you have a 100GB node and you start 1 Windows Pod with a default 20GB limit:

  1. Immediate Usage: The pod only consumes the size of its Base Image (read-only, shared) + a tiny amount of metadata for the scratch space (a few MBs).
    • Example: If your base image is 5GB, the node uses ~5GB.
    • Remaining Space on Node: ~95GB.
  2. Growth: As your application writes data to C:\, the scratch file grows dynamically.
    • If your app writes 1GB of logs, the node now has ~94GB free.
    • If your app writes 10GB of temp files, the node now has ~85GB free.
  3. The Limit: If your app tries to write 21GB of data, the container will crash or get an “Out of Disk Space” error, because it hit its virtual 20GB limit.
    • However, the Node still had space (roughly 75GB free), but the container was not allowed to use it.

Summary Table

StateContainer Sees (Inside)Node Sees (Outside)
Pod Just StartedC: has ~20GB FreeNode used ~5GB (Base Image)
Pod Writes 2GBC: has ~18GB FreeNode used ~7GB (Base + 2GB)
Pod Writes 25GBError: Disk FullNode still has ~70GB Free (Unused)
AWS - Amazon Web Service, Kubernetes, Pod

Post navigation

Previous Post: [Azure] Boosting Azure Network Performance with Accelerated Networking on AKS
Next Post: Running VMware Workstation inside a Windows 11 virtual machine hosted on an ESXi server.

More Related Articles

[Rancher/K8s] Install rancher on K8s by Helm 3 Kubernetes
[Security Group/Terraform] Look into some exciting in Security Group Terraform AWS - Amazon Web Service
[Metrics Server] Failed to make webhook authorizer request: the server could not find the requested resource Kubernetes
[Spinnaker] clouddriver.kubernetes.op.job.KubectlJobExecutor$KubectlException: Deploy failed Kubernetes
Accelerating Data Access: Effective Initialization of Amazon EBS Volumes AWS - Amazon Web Service
[AWS] Create EKS Cluster and EKS Node Groups in Public and Private Subnets AWS - Amazon Web Service

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Tham Gia Group DevOps nhé!
Để Nim có nhiều động lực ra nhiều bài viết.
Để nhận được những thông báo mới nhất.

Recent Posts

  • [Telegram/Openclaw] Configure openclaw bot in a Telegram group. March 31, 2026
  • Tutorial: Gateway API + Traefik + oauth2-proxy (Microsoft Entra ID) March 30, 2026
  • Full + incremental backup: When restoring, do deleted files come back? March 27, 2026
  • [K8S] Create long-lived kubeconfig on k8s March 23, 2026
  • [Android Phone] How to ssh to Android Phone. March 20, 2026

Archives

  • March 2026
  • February 2026
  • January 2026
  • December 2025
  • November 2025
  • October 2025
  • September 2025
  • August 2025
  • July 2025
  • June 2025
  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021

Categories

  • AI
    • OpenClaw
  • BareMetal
    • NextCloud
  • CI/CD
    • Argo Events
    • ArgoCD
    • ArgoWorkflows
    • Git
      • Bitbucket
    • Harbor
    • Jenkins
    • Spinnaker
    • TeamCity
  • Coding
    • DevSecOps
    • Golang
    • Jquery & JavaScript
    • Laravel
    • NextJS 14 & ReactJS & Type Script
    • Python
    • Selenium
    • Terraform
      • AWS – Amazon Web Service
      • Azure Cloud
      • GCP – Google Cloud
  • Kubernetes & Container
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Docker
    • Helm Chart
    • Isito-EnvoyFilter
    • Kong Gateway
    • Kubernetes
      • Gateway API
      • Ingress
      • Pod
    • Longhorn – Storage
    • MetalLB
    • OAuth2 Proxy
    • Vault
    • VictoriaMetrics
  • Log, Monitor & Tracing
    • DataDog
    • ELK
      • Kibana
      • Logstash
    • Fluent
    • Grafana
    • Prometheus
  • Uncategorized
  • Admin

Copyright © 2026 NimTechnology.