Repository navigation
Description
Problem
The root disk of the control-plane node stays too full after #2147. On 2026-11-05 the node exporter shows 30.7 GiB free of about 220 GiB, about 86% used. The warning LocalPathNodeDiskHigh fires for this node. k8s/README.md says that the kubelet starts to delete unused images at 85% and evicts pods under DiskPressure.
What holds the space, on 2026-11-05:
- The Ollama model store, the hostPath
/var/lib/ollama: 128 GiB (duin an Ollama pod on the node). - Container images: 20.7 GiB (
imageFsin the kubelet's/stats/summary). - The Prometheus data: 2.2 GiB (
du). Loki and Grafana are not measured. The estimate for the three volumes of fix(k8s): the volumes of grafana, the prometheus server and loki move off the control-plane node, and their placement exemptions go #2147 is 4 to 6 GiB.
So #2147 frees about 2% of the disk, and only after a person deletes the old volumes.
Expected
The root disk of the control-plane node stays under the 85% threshold, with a margin for model updates and for the growth of the volumes that stay on it.
Acceptance criteria
- The root filesystem of the control-plane node is under 75% used.
-
LocalPathNodeDiskHighdoes not fire for this node for 7 days. - Each model that the tiers of this node need stays available, and the fix writes down which models the node keeps.
Existing tool considered
ollama rm removes a model that no tier of this node uses. If the node needs all its models, a person extends the disk or moves the model store to another disk with the tools of the host. That is a host change, so a person does it.
Related
Proposed design
Problem statement
The root disk of the control-plane node is about 86% used, above the 85% where the kubelet starts to delete images. The Ollama model store on the node holds 128 GiB of the about 220 GiB. Most of those models serve no tier of the node, because Ollama keeps every model that a person pulled. The fix removes the models that no tier of a node serves, through the Ollama API, and writes down the models that each node keeps. #2147 frees about 2% and does not solve this.
Acceptance criteria
Requirement: The prune keeps the models of the node
The prune command SHALL remove only a model that no tier on the node serves.
Scenario: One extra model on a node with two tiers
- WHEN a node runs the tiers
ollama-16gibandollama-24gib-embed-gpu0, and its store holds a Gemma model that neither tier serves - THEN the plan names the Gemma model for that node and names no other model.
Requirement: The plan names each node and each model once
The plan SHALL name each model to remove once for each node, also when two tiers of the node serve the same model.
Scenario: A model that two tiers of one node serve
- WHEN the tiers
ollama-48gibandollama-64gibrun on one node and both serveqwen3.8:27b - THEN the keep set of the node holds one
qwen3.8:27b, and the plan names the node once.
Requirement: A dry run makes no request
--dry-run MUST make no request to the cluster and MUST print each kubectl exec and ollama rm command that it would run.
Scenario: Dry run of the prune
- WHEN a person runs
devops k8s ollama prune --dry-run - THEN the output holds the
kubectl execcommand of each node, and no request leaves the workstation.
Requirement: The written keep set matches the gateway config
k8s/README.md MUST name each model that each serving tier keeps, and a test MUST fail when a name differs from llm/gateway/config.yaml.
Scenario: A model added to the gateway config
- WHEN
llm/gateway/config.yamlnames a model that the table ofk8s/README.mddoes not - THEN
tests/test_k8s_ollama_models.pyfails and names the model and the tier.
Requirement: An unreadable model list stops the node
The prune MUST remove no model on a node whose ollama list fails, and MUST name that node.
Scenario: ollama list fails on one node
- WHEN the
ollama listof a node exits non-zero - THEN the command removes no model on that node, names the node, and exits non-zero.
Existing Tool Considered
No alternatives check has run on this item. The open, maintained tool is Ollama itself: its CLI (ollama list, ollama ps) and its API (DELETE /api/delete, ollama rm) list and remove a model, and its FAQ names the model store. It lacks the keep set: it does not know which models the tiers of a node serve, so it cannot choose the models to remove, and it has no plan mode. The change builds a thin command around it: about 250 lines of Python and one test file, about 25,000 tokens to build, about 5,000 tokens a year to keep and fix, and about half a day of elapsed time.
Key questions
- Which models does a node keep?: The models that the gateway routes to the tiers with a pod on that node, written in the GPU Placement table of
k8s/README.md. [sources: k8s/README.md] - Is the model store of a node one directory that its tiers share?: Yes. The hostPath
/var/lib/ollamais on the node, each tier mounts it at/home/ollama/.ollama, and the tiers of a node setOLLAMA_NOPRUNEbecause they share the model directory. [sources: k8s/README.md] - How does the prune remove a model?: It calls
ollama rmfor each model that no tier of the node serves, through the Ollama API of a tier pod on that node. (best practice) [sources: k8s/README.md]- Chosen:
ollama rmthrough the Ollama API. Ollama removes the manifest and the blobs together, so the store stays consistent, and its API documents the call. - Rejected: Delete the files of
/var/lib/ollama/modelsfrom a pod. It leaves a manifest that names a missing blob, and the next load of that model fails. - Rejected: Move the store to another disk. It is a host change, and it is deferred to its own issue.
- Chosen:
- Does the fix change the
LocalPathNodeDiskHighrule?: No. The rule stays at 85%, because that is where the kubelet starts to delete images, and the fix lowers the usage of the disk. (best practice) [sources: k8s/monitoring/prometheus-values.yaml:291, k8s/README.md:360, tests/prometheus/test_k8s_monitoring_alerting.py]- Chosen: Keep the rule at 85%. 85% is the limit at which the kubelet acts, so the rule reports the real limit of the node.
- Rejected: Lower the threshold to 75%. It fires on a node where the kubelet does nothing, and it hides the cause of the usage.
- Rejected: Silence the node. A silence hides the DiskPressure that evicts a pod from a local-path volume.
- Where does the fix write down the keep set?: In the GPU Placement section of
k8s/README.md, next to the tier table, with a test that keeps it equal tollm/gateway/config.yaml. (best practice) [sources: k8s/README.md]- Chosen: The GPU Placement section of
k8s/README.md, with a test. A person reads it where the tiers are described, and the test keeps it equal to the gateway config. - Rejected: A new file under
llm/profiles/. It is a second source of truth for what the gateway config already states. - Rejected: The annotations of the DaemonSets only. It is no record that a person reads.
- Chosen: The GPU Placement section of
- When does the prune run?: On demand, after a plan that a person reads, like
devops k8s volume move. (best practice) [sources: k8s/README.md]- Chosen: On demand, after a plan that a person reads. A removal is destructive, and the keep set depends on the pods that run now, so a person reads the plan first.
- Rejected: A CronJob every night. It removes a model that a person pulled on purpose within one day, and it needs a token and RBAC in namespace
llm. - Rejected: An initContainer of each tier. It runs before Ollama serves, so it cannot call the API, and a failed removal stops the pod.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 5, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(k8s)scope of the title gives the scope.The node is at 86% disk usage, past the 85% threshold where kubelet deletes images and evicts pods.Pod eviction and image deletion on the control-plane node would disrupt the entire cluster.It requires identifying removable models, running ollama rm, documenting kept models, and verifying disk usage over 7 days.Both address the control-plane node disk, but #2147 moves specific monitoring volumes while the candidate manages overall disk usage including the 128 GiB Ollama model store.devops-cli-service commentedon Nov 5, 2026
Status set to Ready at f6d57ec (see proposed design in issue body).
Moved to new items: #3659, #3660.
dan-petty commentedon Nov 6, 2026
Evidence on 2026-11-07 for the acceptance criteria (node exporter and alert history in Grafana):
LocalPathNodeDiskHighlast fired for this node on 2026-11-06 at about 07:00Z. It has stayed quiet since. The 7-day window ends on about 2026-11-13.k8s/README.mdyet.This item can close on or after 2026-11-13, if the alert stays quiet and the model list is written down. The old Released volumes still hold some space until a person deletes them (the commands are in the #2147 comment).
devops-cli-service commentedon Nov 7, 2026
Staged: branch
fix/3654-free-the-root-disk-of-the, draft pull request #3954. The pull request plans the item and closes no issue.The task groups, with the tokens of the inputs of each step, for a budget of 64000 tokens:
The runs of the planner and the review made 26 model request(s), and used 1488691 input tokens and 63622 output tokens. The tool calls, in order:
references({"name":"LocalPathNodeDiskHigh"})list_files({"directory":"k8s/llm/gateway"})search_code({"text":"LocalPathNodeDiskHigh"})list_files({"directory":"src/devops_cli/commands/k8s"})file_symbols({"path":"src/devops_cli/commands/k8s/volume.py"})read_file({"path":"k8s/llm/gateway/config.yaml","end_line":120})read_file({"path":"k8s/README.md","start_line":330,"end_line":400})read_file({"path":"src/devops_cli/commands/k8s/__init__.py"})list_files({"directory":"tests/invariants"})list_files({"directory":"tests/k8s"})search_code({"text":"gateway/config.yaml"})repo_map({"directory":"src/devops_cli/k8s"})read_file({"path":"src/devops_cli/commands/k8s/volume.py","start_line":1,"end_line":60})read_issue({"number":2147})read_issue({"number":1634})read_file({"path":"src/devops_cli/commands/k8s/volume.py","start_line":58,"end_line":110})file_symbols({"path":"src/devops_cli/dry_run/requests.py"})search_code({"text":"volume_app"})find_issues({"terms":"ollama prune"})read_issue({"number":3660})search_code({"text":"ollama"})search_code({"text":"llm.devops.io/vram-gib"})search_code({"text":"ollama-48gib-fast"})list_files({"directory":"tests/commands/k8s"})list_files({"directory":"src/devops_cli/lang/en"})read_file({"path":"src/devops_cli/ai/gateway_render.py","start_line":1,"end_line":100})read_file({"path":"k8s/llm/profiles/services.yaml","start_line":240,"end_line":330})read_spec({"capability":"docker-prune"})read_spec({"capability":"local-path-volume-placement"})list_files({"directory":"src/devops_cli/commands"})file_symbols({"path":"src/devops_cli/commands/ci.py"})file_symbols({"path":"tests/commands/k8s/test_k8s.py"})read_file({"path":"tests/invariants/test_dry_run_class_ratchet.py","end_line":60})search_code({"text":"model_list"})search_code({"text":"llm/gateway"})read_file({"end_line":330,"path":"src/devops_cli/k8s/gpu_thresholds.py","start_line":270})read_file({"end_line":30,"path":"tests/k8s/test_gpu_thresholds.py","start_line":1})search_code({"text":"DEFAULT_LLM_GATEWAY_CONFIG_PATH"})search_code({"text":"kubelet starts to delete"})search_code({"text":"DEFAULT_LLM_GATEWAY_CONFIG_PATH"})list_files({"directory":"k8s/llm"})list_files({"directory":"tests/k8s"})read_file({"path":"src/devops_cli/commands/k8s/__init__.py"})read_file({"path":"k8s/llm/gateway/config.yaml","start_line":1,"end_line":70})read_file({"path":"src/devops_cli/commands/k8s/volume.py","start_line":1,"end_line":80})search_code({"text":"llm.devops.io/provider"})list_files({"directory":"src/devops_cli/dry_run"})read_file({"path":"k8s/llm/profiles/services.yaml","start_line":1,"end_line":30})read_file({"path":"k8s/llm/profiles/services.yaml","start_line":245,"end_line":280})file_symbols({"path":"src/devops_cli/k8s/gpu_thresholds.py"})search_code({"text":"ollama prune"})search_code({"text":"volume_reclaim"})find_issues({"terms":"ollama prune model store"})read_issue({"number":3660})list_files({"directory":"src/devops_cli/lang"})list_files({"directory":"src/devops_cli/k8s"})list_files({"directory":"src/devops_cli/lang/en"})list_files({"directory":"src/devops_cli/k8s"})list_files({"directory":"tests/k8s"})list_files({"directory":"src/devops_cli/commands/k8s"})search_code({"text":"LocalPathNodeDiskHigh"})search_code({"text":"ollama prune"})search_code({"text":"_refuse_chat_routes"})read_file({"path":"src/devops_cli/commands/k8s/__init__.py","start_line":120,"end_line":160})read_file({"path":"src/devops_cli/commands/k8s/volume.py","start_line":1,"end_line":100})read_file({"path":"k8s/monitoring/prometheus-values.yaml","start_line":280,"end_line":330})read_file({"path":"src/devops_cli/config/defaults.py","start_line":980,"end_line":1020})read_file({"path":"src/devops_cli/config/constants.py","start_line":1060,"end_line":1100})Tool calls: file_symbols=5 (empty=0), find_issues=2 (empty=0), list_files=16 (empty=0), read_file=20 (empty=0), read_issue=4 (empty=0), read_spec=2 (empty=0), references=1 (empty=0), repo_map=1 (empty=0), search_code=17 (empty=2)
The stage job read the open pull requests and their files in 1 GraphQL request(s).
3 remaining items
devops-cli-service commentedon Nov 7, 2026
Stopped at group 3.
Failure class:
limit_reached.Action taken: none.
Action left:
raise_limit: raise the limit that the run went over.pytest on base: tests/k8s/test_k8s_ollama_prune.pyReason:
Last message of the agent (a claim that no check verified): Now I'll write the failing test first.
The job discarded this work. The diff is cut to 20000 characters. Read it before you retry:
The item is Blocked, and the job will not run it. Fix the cause. Then comment
implement: retry. The Service clears the stop on its own when a new runner image rolls out, but only if a retry can fix the class of the stop and the limits ofroadmap.implement.digest_clears_per_classandroadmap.implement.digest_clears_per_itemallow it.devops-cli-service commentedon Nov 7, 2026
The runner Job devops-cli-runner-20261107-080202-c77f ended: succeeded.
Image digest: sha256:a12d8a3601a2f9803ba6a7f77fe19fdcc27a4de30944a1e65fc19d08808e9eff
The last lines of its log:
fix(k8s): Add the ollama prune command (#3654)
docs(openspec): archive the change (#3654)
fix(k8s): accept Sequence in ollama prune plan helpers (#3654)
devops-cli-service commentedon Nov 7, 2026
Released in v0.82.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.82.0
devops-cli-service commentedon Nov 7, 2026
Live since 2026-11-07 15:48 UTC
test(k8s): confirm root disk stays under 75% for 7 days (#4232)