Skip to content

test(k8s): confirm root disk stays under 75% for 7 days #3660

Closed

Description

@devops-cli-service

Split from #3654.

Problem: #3654 removes the models that no tier of a node serves, but nothing confirms that the free space stays. A model pull fills the store again, and the kubelet deletes images at 85% and evicts pods under DiskPressure. Why deferred: The check waits on an outside event. The prune must run on the live node, and the node must send 7 days of samples before the answer exists. Acceptance criteria: - node_filesystem_avail_bytes{mountpoint=/, instance=``} stays above 25% for 7 days after the prune. - LocalPathNodeDiskHigh does not fire for the node in those 7 days. - ollama list in a tier pod on the node shows each model that k8s/README.md says the node keeps. - A comment on #3654 holds the query and the result.

Proposed design

Problem statement

The prune of #3654 removes the models that no tier of a node serves. Nothing confirms that the freed space stays. A later model pull fills the root filesystem again, and the kubelet deletes images at 85% used and evicts pods under DiskPressure. This item records the 7-day free-space query in k8s/README.md, so the next prune has a method to repeat. The 7-day measurement itself waits on the live node, and a new issue holds it.

Acceptance criteria

Requirement: The free-space query is in the runbook

k8s/README.md SHALL state the PromQL query that reports the free space of one node's root filesystem over the 7 days after a prune, with the 0.25 bound that makes the check pass.

Scenario: The recorded query

  • WHEN A test reads the section of k8s/README.md that describes the check.
  • THEN It finds node_filesystem_avail_bytes, node_filesystem_size_bytes, mountpoint="/", an instance matcher, a [7d] range and 0.25.

Requirement: A test holds the recorded query

The test SHALL name each part of the recorded query, so that a removal fails it.

Scenario: A part of the query is missing

  • WHEN The section no longer holds one of the parts that the test names.
  • THEN The test fails and names the part that it did not find.

Existing Tool Considered

No alternatives check has run. Prometheus, scraped by the k8s-monitoring chart with node-exporter, covers the measurement. It serves node_filesystem_avail_bytes and node_filesystem_size_bytes for the root filesystem of each node, and it keeps 30 days of samples. It lacks two things: it cannot shorten the 7-day wait, and it cannot list the models of a tier pod. ollama list answers the second. The remaining change builds no code, so it has no written cost. It adds one section to k8s/README.md and one test.

Key questions

  • Which series report the free space of a node's root filesystem?: node_filesystem_avail_bytes and node_filesystem_size_bytes, with mountpoint="/". node-exporter serves both series. The hostMetrics block of the k8s-monitoring chart keeps every series that node-exporter serves, with no allow list. LocalPathNodeDiskHigh reads the same two series. [sources: k8s/monitoring/prometheus-values.yaml:301, k8s/README.md:458]
  • Does Prometheus keep the 7 days of samples that the query reads?: Yes. server.retention is 30d, so the samples of the 7 days after the prune stay. server.retentionSize is 16GB, which sits above 30 days of samples. [sources: k8s/monitoring/prometheus-values.yaml, k8s/README.md]
  • Which expression states that the root filesystem stays above 25% free?: Divide node_filesystem_avail_bytes by node_filesystem_size_bytes, with mountpoint="/", the instance of the node and a [7d] range. The check passes while the ratio stays above 0.25, so the failing query selects samples at or below 0.25. (best practice) [sources: k8s/monitoring/prometheus-values.yaml:301, k8s/README.md:458]
    • Chosen: Ratio of available bytes to size bytes. node-exporter serves both series for each filesystem, and the ratio states the percentage of the criterion.
    • Rejected: node_filesystem_avail_bytes alone. The series is a byte count, so no threshold states 25%.
    • Rejected: node_filesystem_free_bytes alone. Free bytes are a byte count too, and they leave out the space that only root may use.
  • Does LocalPathNodeDiskHigh prove the 25% bound?: No. The rule fires at 85% used, 10 points above the 75% bound, and only after 15 minutes. It guards the image deletion of the kubelet. The ratio query states the bound. [sources: k8s/monitoring/prometheus-values.yaml:301, k8s/README.md:481, tests/prometheus/test_k8s_monitoring_alerting.py]
  • How does the query name the node?: By the instance label of the node-exporter series. The section gives one query for each node that mounts the model directory /var/lib/ollama. Each of these nodes has its own root filesystem and its own model store. (best practice) [sources: k8s/monitoring/prometheus-values.yaml:301, k8s/README.md:387]
    • Chosen: One query for each node, matched by instance. Each node has its own root filesystem and model store, so one result says nothing about another node.
    • Rejected: One query with no instance matcher. The result then mixes every node, and a full node hides behind the others.
    • Rejected: The control-plane node alone. The control-plane node holds the store of the slow tier, and each GPU node holds its own store.
  • Where does the query live, and where does the result go?: The query goes into k8s/README.md, beside the alert and the tier notes, because that file is the runbook for the cluster. The result goes into a comment on fix(k8s): free the root disk of the control-plane node #3654, because CONTRIBUTING.md puts test results and the history of the issue in a comment. (best practice) [sources: k8s/README.md:387, CONTRIBUTING.md, AGENTS.md]
  • Does the 7-day measurement belong in this item?: No. The measurement waits on the live prune of fix(k8s): free the root disk of the control-plane node #3654 and on 7 days of samples, and no pull request delivers that wait. This item records the query, and a test holds it. A new issue holds the 7-day measurement and the comment on fix(k8s): free the root disk of the control-plane node #3654. (best practice) [sources: k8s/README.md:387]
    • Chosen: Record the query now, and defer the 7-day measurement. A pull request delivers the runbook section and its test, and the measurement needs a live node and 7 days of samples.
    • Rejected: Keep the whole item and mark it blocked. A blocked item delivers nothing during the wait, and the runbook gains no method to repeat.
    • Rejected: Defer the whole item. The runbook section and its test are a document change that a pull request delivers now.
  • Which test holds the recorded query?: tests/prometheus/test_k8s_monitoring_alerting.py. That module already reads k8s/README.md with _readme_section, so it holds a section of the runbook against a rule. [sources: tests/prometheus/test_k8s_monitoring_alerting.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Alternatives check of 2026-11-07: not-applicable.
Class: test, no search.
Tool: none found.

Activity

  1. added
    source/agent
    type/test
    scope/k8s
    status/new
    value/medium
    effort/low
    on Nov 5, 2026
  2. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    ContributorAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/test. The test prefix of the title gives the type.
    • Scope: scope/k8s. The (k8s) scope of the title gives the scope.
    • Priority: P2-Medium. It verifies a shipped fix but blocks no other work.
    • Value: Medium. It confirms the prune is durable and prevents a silent regression.
    • Effort: Low. The work is to run queries, wait 7 days, and post a comment.
    • Related: fix(k8s): free the root disk of the control-plane node #3654, which asks for a different change. Both target the control-plane root disk; dan-petty/devops-cli#3654 delivers the prune, the candidate confirms the result holds for 7 days.
  3. changed the title [-]test(k8s): confirm the control-plane root disk stays under 75% for 7 days[/-] [+]test(k8s): confirm root disk stays under 75% for 7 days[/+] on Nov 6, 2026
  4. dan-petty commented on Nov 6, 2026

    @dan-petty
    Owner

    The job shortened the title of this item. The summary had 62 characters, and the limit is 60. The type and the scope stay.

    • Before: test(k8s): confirm the control-plane root disk stays under 75% for 7 days
    • After: test(k8s): confirm root disk stays under 75% for 7 days
    • Source of the summary: the background model
  5. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    ContributorAuthor

    Refine cannot set this item to Ready at 235a807 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.

  6. added
    status/ready
    and removed
    status/new
    on Nov 7, 2026
  7. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    ContributorAuthor

    Status set to Ready at a2711a1 (see proposed design in issue body).

    Moved to new items: dan-petty/homelab#334.

  8. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    ContributorAuthor

    Alternatives check: not-applicable

    Class: test. The check makes no search and no model call for an item of this class.

    Tool: none found

    Checked on 2026-11-07. A person decides what this means for the item. The check changes no label and closes no issue.

  9. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    ContributorAuthor

    Staged: branch test/3660-confirm-root-disk-stays-under-75, draft pull request #4232. 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:

    1. Record the free-space query in the runbook and hold it with a test: 30319 tokens

    The runs of the planner and the review made 57 model request(s), and used 4047522 input tokens and 113043 output tokens. The tool calls, in order:

    1. search_code({"text":"node_filesystem_avail_bytes"})
    2. search_code({"text":"_readme_section"})
    3. search_code({"text":"LocalPathNodeDiskHigh"})
    4. read_issue({"number":3654})
    5. read_file({"path":"tests/prometheus/test_k8s_monitoring_alerting.py","start_line":1260,"end_line":1430})
    6. read_file({"path":"k8s/README.md","start_line":370,"end_line":510})
    7. read_file({"path":"k8s/README.md","start_line":432,"end_line":500})
    8. search_code({"text":"retention"})
    9. read_file({"path":"k8s/README.md","start_line":315,"end_line":350})
    10. read_file({"path":"k8s/monitoring/prometheus-values.yaml","start_line":255,"end_line":330})
    11. read_file({"path":"k8s/README.md","start_line":489,"end_line":560})
    12. search_code({"text":"Prune unused models"})
    13. list_files({"directory":"openspec/changes/archive/2026-11-07-3654-free-the-root-disk-of-the"})
    14. read_file({"path":"openspec/changes/archive/2026-11-07-3654-free-the-root-disk-of-the/tasks.md"})
    15. read_file({"path":"k8s/README.md","start_line":170,"end_line":200})
    16. read_file({"path":"k8s/README.md","start_line":549,"end_line":620})
    17. search_code({"text":"K8S_README"})
    18. list_files({"directory":"openspec/changes/archive/2026-11-02-2572-the-cloudflare-tunnel-section-of-k8s"})
    19. list_files({"directory":"openspec/changes/archive/2026-10-29-1648-k8s-readme-homelab"})
    20. find_issues({"terms":"node_filesystem_avail_bytes"})
    21. find_issues({"terms":"ollama prune"})
    22. read_file({"path":"tests/prometheus/test_k8s_monitoring_alerting.py","start_line":1,"end_line":80})
    23. read_file({"path":"tests/prometheus/test_k8s_monitoring_alerting.py","start_line":1200,"end_line":1260})
    24. read_issue({"number":4001})
    25. read_issue({"number":3659})
    26. read_file({"path":"tests/prometheus/test_k8s_monitoring_alerting.py","start_line":520,"end_line":600})
    27. search_code({"text":"uv run devops ci test"})
    28. search_code({"text":"retentionSize"})
    29. read_file({"path":"k8s/monitoring/prometheus-values.yaml","start_line":1,"end_line":60})
    30. search_code({"text":"private address"})
    31. list_files({"directory":"tests/invariants"})
    32. read_file({"path":"tests/prometheus/test_k8s_monitoring_alerting.py","start_line":1250,"end_line":1340})
    33. search_code({"text":"_readme_section"})
    34. search_code({"text":"LocalPathNodeDiskHigh"})
    35. read_issue({"number":3654})
    36. read_file({"path":"k8s/README.md","start_line":440,"end_line":570})
    37. read_file({"path":"k8s/monitoring/prometheus-values.yaml","start_line":1,"end_line":20})
    38. read_issue({"number":4001})
    39. list_files({"directory":"tests/invariants"})
    40. read_file({"end_line":620,"path":"k8s/README.md","start_line":500})
    41. read_file({"end_line":200,"path":"k8s/README.md","start_line":170})
    42. read_file({"end_line":320,"path":"k8s/monitoring/prometheus-values.yaml","start_line":290})
    43. find_issues({"terms":"node_filesystem_avail_bytes"})
    44. read_file({"end_line":40,"path":"tests/invariants/test_committed_addresses.py","start_line":1})
    45. search_code({"text":"uv run devops ci test"})
    46. read_file({"path":"tests/prometheus/test_k8s_monitoring_alerting.py","start_line":1250,"end_line":1420})
    47. read_file({"path":"k8s/monitoring/prometheus-values.yaml","start_line":280,"end_line":330})
    48. read_file({"path":"k8s/README.md","start_line":160,"end_line":210})
    49. read_file({"path":"k8s/README.md","start_line":370,"end_line":560})
    50. read_file({"path":"k8s/README.md","start_line":430,"end_line":580})
    51. search_code({"text":"### Receiver"})
    52. read_file({"end_line":545,"path":"k8s/README.md","start_line":490})
    53. read_file({"end_line":1250,"path":"tests/prometheus/test_k8s_monitoring_alerting.py","start_line":1180})
    54. search_code({"text":"node_filesystem_avail_bytes"})
    55. search_code({"text":"_readme_section"})
    56. search_code({"text":"uv run devops ci test"})
    57. read_issue({"number":4001})
    58. list_files({"directory":"openspec/specs"})
    59. read_file({"path":"k8s/monitoring/prometheus-values.yaml","start_line":1,"end_line":20})
    60. read_spec({"capability":"ollama-model-prune"})
    61. read_spec({"capability":"local-path-volume-placement"})
    62. search_code({"text":"K8S_README"})
    63. search_code({"text":"k8s/README.md"})
    64. read_file({"end_line":575,"path":"k8s/README.md","start_line":545})
    65. read_file({"end_line":120,"path":"tests/k8s/test_k8s_ollama_models.py","start_line":1})
    66. read_spec({"capability":"roadmap-plan-check"})
    67. read_spec({"capability":"roadmap-refine"})
    68. search_code({"text":"0.25"})
    69. read_file({"path":"tests/invariants/test_committed_addresses.py","start_line":1,"end_line":30})
    70. read_file({"path":"AGENTS.md","start_line":1,"end_line":130})
    71. read_file({"path":"openspec/config.yaml"})
    72. read_spec({"capability":"roadmap-plan-check","requirement":"The plan reader reports a criterion that the model refuses"})
    73. read_spec({"capability":"roadmap-plan-check","requirement":"Plan-check measures each task group"})
    74. search_code({"text":"pending-person"})
    75. search_code({"text":"Pending a person"})
    76. read_spec({"capability":"roadmap-stage"})
    77. read_spec({"capability":"roadmap-stage","requirement":"Criteria mapping in the stage reply"})
    78. read_spec({"capability":"roadmap-stage","requirement":"An unmapped criterion is refused"})
    79. read_issue({"number":3654})
    80. find_issues({"terms":"node_filesystem_avail_bytes"})
    81. read_file({"end_line":345,"path":"tests/server/routes/test_k8s_roadmap_service.py","start_line":310})
    82. search_code({"text":"LocalPathNodeDiskHigh"})
    83. read_spec({"capability":"roadmap-stage","requirement":"A finding has one of the nine defect types"})
    84. read_spec({"capability":"roadmap-stage","requirement":"An evidence-backed finding returns the plan at most twice"})
    85. references({"name":"3660"})
    86. search_code({"text":"4001"})
    87. read_file({"path":"openspec/changes/archive/2026-11-07-3654-free-the-root-disk-of-the/tasks.md","start_line":1,"end_line":45})
    88. read_file({"path":"openspec/changes/archive/2026-11-07-3654-free-the-root-disk-of-the/proposal.md","start_line":45,"end_line":75})
    89. search_code({"text":"hostMetrics"})
    90. search_code({"text":"node_filesystem_size_bytes"})
    91. read_file({"end_line":140,"path":"k8s/monitoring/k8s-monitoring-values.yaml","start_line":80})
    92. read_file({"end_line":380,"path":"k8s/monitoring/prometheus-values.yaml","start_line":355})
    93. search_code({"text":"comment"})
    94. read_file({"path":"CONTRIBUTING.md","start_line":1,"end_line":100})
    95. search_code({"text":"history of the issue"})
    96. search_code({"text":"test results"})
    97. search_code({"text":"ollama list"})
    98. search_code({"text":"kubectl -n llm exec"})
    99. read_spec({"capability":"roadmap-stage","requirement":"A verify command has the project form"})
    100. read_spec({"capability":"roadmap-stage","requirement":"The reader judges every verification command"})
    101. read_spec({"capability":"roadmap-stage","requirement":"The plan reader keeps the document work of a group"})
    102. read_spec({"capability":"roadmap-stage","requirement":"A task group has a kind"})
    103. search_code({"text":"free_space"})
    104. search_code({"text":"Free space of the root disk"})
    105. read_spec({"capability":"roadmap-stage","requirement":"A plan text is no placeholder"})
    106. read_spec({"capability":"roadmap-stage","requirement":"A verify command holds no backtick"})
    107. search_code({"text":"def test_command"})
    108. search_code({"text":"ci test"})
    109. search_code({"text":"[7d]"})
    110. search_code({"text":"min_over_time"})
    111. search_code({"text":"heading"})
    112. search_code({"text":"## Alerting"})
    113. read_spec({"capability":"roadmap-stage","requirement":"A claim about every member of a set"})
    114. read_spec({"capability":"roadmap-stage","requirement":"The stage prompt asks for the hit count of a negative search"})
    115. read_spec({"capability":"roadmap-stage","requirement":"Feasibility quotes a probe line"})
    116. read_spec({"capability":"roadmap-stage","requirement":"The probe names the files of a cited bare name"})
    117. read_spec({"capability":"roadmap-stage","requirement":"A task group renders without stray punctuation"})
    118. read_spec({"capability":"roadmap-stage","requirement":"A text of a group stays on one line"})

    Tool calls: find_issues=4 (empty=0), list_files=6 (empty=0), read_file=39 (empty=0), read_issue=7 (empty=0), read_spec=23 (empty=0), references=1 (empty=0), search_code=38 (empty=2)

    The stage job read the open pull requests and their files in 1 GraphQL request(s).

  10. added
    owner/service
    status/in-progress
    and removed
    status/ready
    on Nov 9, 2026
  11. added
    status/in-review
    and removed
    status/in-progress
    on Nov 9, 2026
  12. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    ContributorAuthor

    Pull request #4232 is ready for review. The checks passed.

    Spend: 25 model requests, 1198559 input tokens, 7939 output tokens.

  13. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    ContributorAuthor

    The runner Job devops-cli-runner-20261109-141006-ad0c ended: succeeded.
    Image digest: sha256:0ac3d37efcdffdebfd9323095ae0f968f5951f88464d567878edc1ad61b0187d

    The last lines of its log:

    Tool call: shell, started: uv run devops ci docs 2>&1 ...
    Tool call: shell, program uv, ok.
    Tool call: shell, started: uv run ruff check tests/prometheus/test_k8s_monitoring_alerting.py
    Tool call: shell, started: uv run devops openspec check 2>&1 ...
    Tool call: shell, program uv, ok.
    Tool call: shell, program uv, ok.
    Tool call: shell, started: uv run ast-grep scan tests/prometheus/test_k8s_monitoring_alerting.py 2>&1 ...
    Tool call: shell, started: uv run pytest tests/invariants/test_committed_addresses.py -q 2>&1 ...
    Tool call: shell, program uv, ok.
    Tool call: shell, program uv, ok.
    Tool call: read_file, ok.
    Tool call: edit_file, ok.
    Tool call: edit_file, ok.
    Tool call: shell, started: git status --porcelain
    Tool call: shell, program git, ok.
    Tool call: shell, started: git status
    Tool call: shell, started: git diff --stat
    Tool call: shell, program git, ok.
    Tool call: shell, program git, ok.
    Tool call: shell, started: git log --stat -1 --oneline
    Tool call: shell, program git, ok.
    Tool call: shell, started: git log --stat -3 --oneline
    Tool call: shell, program git, ok.
    Formatted: tests/prometheus/test_k8s_monitoring_alerting.py
    The checks of pull request dan-petty/devops-cli#4232 still run after 39 s.
    The checks of pull request dan-petty/devops-cli#4232 still run after 78 s.
    The checks of pull request dan-petty/devops-cli#4232 still run after 117 s.
    The checks of pull request dan-petty/devops-cli#4232 still run after 156 s.
    The checks of pull request dan-petty/devops-cli#4232 still run after 195 s.
    The checks of pull request dan-petty/devops-cli#4232 still run after 235 s.
    The checks of pull request dan-petty/devops-cli#4232 still run after 273 s.
    The checks of pull request dan-petty/devops-cli#4232 still run after 312 s.
    The checks of pull request dan-petty/devops-cli#4232 still run after 351 s.
    The checks of pull request dan-petty/devops-cli#4232 still run after 390 s.
    The checks of pull request dan-petty/devops-cli#4232 still run after 429 s.
    The checks of pull request dan-petty/devops-cli#4232 still run after 468 s.
    The checks of pull request dan-petty/devops-cli#4232 still run after 507 s.
    The checks of pull request dan-petty/devops-cli#4232 still run after 546 s.
    ✓ Took 1 item(s) to a ready pull request, stopped 0.
    Elapsed: 27m 16s
    
  14. removed
    owner/service
    on Nov 9, 2026
  15. removed
    status/in-review
    on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/k8ssource/agenttype/testvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions