Skip to content

Commit 387d2ea

Browse files
docs(docker-to-sealos): document sandbox storage pressure (#69)
1 parent f0950bb commit 387d2ea

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

skills/docker-to-sealos/references/conversion-mappings.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,9 @@ metadata:
991991
### Existing Template Resource Tuning
992992
- Tune CPU and memory through the Sealos resource ladder.
993993
- Preserve existing `ephemeral-storage` requests and limits exactly during template refreshes.
994-
- Change `ephemeral-storage` only when runtime evidence shows `EphemeralStorage`, eviction, or disk-pressure failures for that workload.
994+
- Change `ephemeral-storage` only when live evidence shows `EphemeralStorage`, eviction, or disk-pressure failures for that workload.
995+
- Adjust `requests.ephemeral-storage` and `limits.ephemeral-storage` together for the same container.
996+
- Choose the smallest common Mi value that covers observed writable-layer usage plus startup margin; Dify sandbox uses `512Mi` after `300Mi` eviction and observed runner expansion under `/opt` and `/var/sandbox`.
995997

996998
### Configuration Files
997999
- Docker config files → ConfigMap (using vn- naming convention)

skills/docker-to-sealos/references/runtime-log-hygiene.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,32 @@ Fix pattern:
6363
3. Keep PVCs for real user data and writable runtime state.
6464
4. Redeploy fresh and re-run setup/login plus log scan.
6565

66+
## Ephemeral Local Storage Pressure
67+
68+
Tune `ephemeral-storage` only from live runtime evidence.
69+
70+
Detection signals:
71+
72+
- Events contain `Pod ephemeral local storage usage exceeds the total limit of containers ...`.
73+
- The pod is repeatedly `Evicted` while the workload's main process otherwise starts.
74+
- `kubectl describe pod` shows tight `requests.ephemeral-storage` and `limits.ephemeral-storage` values for the failing container.
75+
- Logs show large runtime extraction or dependency bootstrap shortly before eviction.
76+
77+
Debug pattern:
78+
79+
1. Inspect recent events with `kubectl get events --sort-by=.lastTimestamp` and filter for the workload name, `Evicted`, or `ephemeral`.
80+
2. Inspect the failing container resources with `kubectl describe pod` or `kubectl get pod -o jsonpath`.
81+
3. When the pod survives long enough, run `du -sh /opt /var /var/sandbox /tmp /root /var/cache 2>/dev/null` inside the container to identify runtime-expanded directories.
82+
4. Patch the live workload to the smallest Mi value that covers observed writable-layer usage with startup margin.
83+
5. Observe beyond the previous eviction window, then update both `requests.ephemeral-storage` and `limits.ephemeral-storage` together in the template.
84+
85+
Dify sandbox case study:
86+
87+
- `langgenius/dify-sandbox:0.2.15` expands Node and Python runner assets during startup.
88+
- Observed writable-layer directories included `/opt/node-v20.20.0-linux-x64` at about `167Mi` and `/var/sandbox` at about `174Mi`.
89+
- `300Mi` caused repeated eviction with `Pod ephemeral local storage usage exceeds the total limit of containers 300Mi`.
90+
- `512Mi` kept `dify-sandbox` Ready with zero restarts after the old eviction window.
91+
6692
## Restricted-Compatible Security Context
6793

6894
When the image default UID is verified as non-root through image metadata, upstream docs, or `id` inside a live container, set restricted-compatible security context on managed app workloads and init Jobs:

0 commit comments

Comments
 (0)