Repository navigation
Description
Problem
The rule of #1634 keeps every local-path volume off the control-plane node, because its root disk was 86% full. The test tests/core/test_k8s_local_path_placement.py requires the DoesNotExist control-plane affinity on each pod that mounts a claim. Two things changed on 2026-11-06:
- The root disk of the control-plane node is no longer the limit. A 916 GB NVMe is mounted at
/mnt/nvme-storage, the Ollama store (128 GB) moved to it, and the root disk is at 25% used with 158 GB free. The homelab provisioner config maps this node to/mnt/nvme-storage/k8s(dan-petty/homelab PR feat(release): v0.2.0 #17). So a volume on this node is safe when it is on the NVMe. - The test has a gap. It reads claims from charts and StatefulSets. It does not read a CloudNativePG
Cluster. So the gateway database (llm-gateway-db, feat(k8s): the LiteLLM gateway keeps virtual keys in an in-cluster Postgres, so devops-cli can mint scoped, expiring gateway keys #1635) and the Mattermost database (fix(k8s): move the mattermost database off the control plane #3647) landed on the control-plane node, on the root disk, and the test did not see them.
Expected
The rule says what is really required: a volume of the control-plane node lives on the NVMe, and every kind of claim owner is covered by the test.
Acceptance criteria
- The test reads each
postgresql.cnpg.io/v1Clusterink8s/with a local-path storage class, and applies the same rule as it does to a StatefulSet. - The rule text in
k8s/README.md(Local-Path Volume Placement) states the new reason and the new rule: a pod may run on the control-plane node when its volume path is under the NVMe base directory of that node, and the README names the provisioner config as the place where the path is set. - The test keeps its table of exemptions. An entry names the claim, the reason, and the issue that removes it. The gateway database and the Mattermost database (fix(k8s): move the mattermost database off the control plane #3647) are entries until their volumes are on the NVMe.
- A check reads the live volumes and fails when a local-path volume of the control-plane node is under the root-disk base directory (
/var/lib/rancher/k3s/storage). Use the existing alert and metric path (LocalPathNodeDiskHigh,HostFilesystemSpaceLow) if it can express this. If no metric holds the path of a volume, say so and file the follow-up. -
devops k8s volume moveaccepts the control-plane node as a target when the target path is on the NVMe, or the README says why it does not.
Existing tool considered
The existing test, alerts and devops k8s volume move are the tools. No new tool is needed. The cost is about 300,000 tokens and 2 hours.
Related
#1634, #2147, #3647, #3654, #1635, dan-petty/homelab PR #17 and #18.
Proposed design
Problem statement
The rule of #1634 keeps every local-path volume off the control-plane node, because its root disk was the limit. The control-plane node now holds a 916 GB NVMe at /mnt/nvme-storage, and the provisioner config maps its volume path there. The check misses CloudNativePG Cluster objects, so the gateway database and the Mattermost database landed on the root disk unseen. This change states the real rule, adds the Cluster kind to the check, and records the two databases as exemptions until their volumes move.
Acceptance criteria
Requirement: CNPG Cluster is a claim owner
The placement check SHALL treat each postgresql.cnpg.io/v1 Cluster under k8s/ that names a local-path storage class as a claim owner.
Scenario: A Cluster on the local-path class
- WHEN A manifest holds a
Clusterwithspec.storage.storageClass: local-pathand no node affinity. - THEN The check lists the key
<file>:Cluster/<name>in the set of claim owners that it checks.
Requirement: Cluster without the term fails
The placement check SHALL fail when a Cluster on a local-path storage class lacks the control-plane DoesNotExist term in a term of its required node affinity.
Scenario: A Cluster with a second term that admits the node
- WHEN A
Clustersets twonodeSelectorTerms, and only the first holds the control-planeDoesNotExistterm. - THEN The check fails and names the key of that
Cluster.
Requirement: Cluster with the term passes
The placement check SHALL pass a Cluster that holds the control-plane DoesNotExist term in every term of its required node affinity.
Scenario: A Cluster that keeps off the node
- WHEN A
Clustersets theDoesNotExistterm in eachnodeSelectorTermofspec.affinity. - THEN The check reports no failure for that
Cluster.
Requirement: Exemption names its removing issue
The exemption table SHALL hold the claim, the reason and the number of the issue that removes the entry, and the check SHALL fail on an entry with no issue.
Scenario: An entry with no issue
- WHEN An exemption entry names a claim, a reason and an empty issue.
- THEN The check fails and names the claim of that entry.
Requirement: Both databases are exempt
The exemption table SHALL name the gateway database llm-gateway-db and the Mattermost database mattermost-db, with #1635 and #3647 as their removing issues.
Scenario: The two databases are exempt
- WHEN The check reads the manifests under
k8s/. - THEN The two
Clusterkeys are in the exemption table, and the check reports no failure for them.
Requirement: README states the NVMe rule
The Local-Path Volume Placement section of k8s/README.md SHALL state that a volume of the control-plane node lives on the NVMe base directory, and SHALL name the provisioner config as the place that sets the path.
Scenario: The section states the reason and the rule
- WHEN A reader opens the Local-Path Volume Placement section.
- THEN The section names
/mnt/nvme-storage, the ConfigMaplocal-path-configand the rule that a volume of the control-plane node is on the NVMe.
Requirement: README states why the move refuses the control-plane node
The Local-Path Volume Placement section SHALL state why devops k8s volume move refuses the control-plane node as a target.
Scenario: The refusal has its reason
- WHEN A reader reads the paragraph on
devops k8s volume move. - THEN The text says that the provisioner chooses the base directory from the node's config, so the command cannot prove that the new volume is on the NVMe.
Requirement: README states the missing metric
The Local-Path Volume Placement section SHALL state that no metric holds the path of a local-path volume, so no alert reports a volume on the root disk.
Scenario: The section states the missing metric
- WHEN A reader reads the paragraph on
LocalPathNodeDiskHigh. - THEN The text says that
LocalPathNodeDiskHighreads the root filesystem only and that no series holds the path of a volume.
Existing Tool Considered
No alternatives check has run. No open, maintained tool covers the need: the check maps each chart value and each manifest of this repository to the affinity of the pod that mounts a claim, and no general Kubernetes linter reads a Helm values file for that. The change extends the existing test, the alerts and devops k8s volume move, so the project builds and keeps its own code. The written cost of that code is about 300,000 tokens and 2 hours.
Key questions
- Which fields of a CloudNativePG
Clusterhold the storage class and the node affinity of its pods?:spec.storage.storageClassnames the class, andspec.affinityholds the node affinity that the operator copies to each instance pod. The check reads both fields. [sources: k8s/llm/gateway-db.yaml, k8s/README.md] - Does the check apply the control-plane
DoesNotExistrule to a CNPGCluster, or does it read the provisioner config instead?: It applies the same rule to theClusteraffinity. A file-only check cannot know the base directory that the provisioner chooses, and the config lives in dan-petty/homelab. (best practice) [sources: tests/core/test_k8s_local_path_placement.py, k8s/README.md]- Chosen: Extend the affinity rule to
Clusterobjects. The rule stays the same for every claim owner, and the check reads files only. - Rejected: Read the provisioner config instead. The config lives in dan-petty/homelab, so the check would depend on a repository it does not read.
- Rejected: Drop the rule and rely on
LocalPathNodeDiskHigh. The alert reads the root filesystem only and fires after the disk is 85% used.
- Chosen: Extend the affinity rule to
- Should the check exempt the gateway database and the Mattermost database, or add the affinity to them now?: Exempt both until their volumes move, with feat(k8s): the LiteLLM gateway keeps virtual keys in an in-cluster Postgres, so devops-cli can mint scoped, expiring gateway keys #1635 for the gateway database and fix(k8s): move the mattermost database off the control plane #3647 for the Mattermost database. Their volumes are bound on the control-plane node, so a pod with the affinity would not start. (best practice) [sources: k8s/README.md, k8s/llm/gateway-db.yaml]
- Chosen: Exempt both with their removing issues. The exemption paragraph of the README covers a pod whose volume is still on the control-plane node.
- Rejected: Add the affinity to both
Clusterobjects now. Each pod would stay Pending and the database would go down.
- Does a metric hold the path of a local-path volume, so that an alert can report a volume on the root disk?: No.
LocalPathNodeDiskHighreadsmountpoint="/"only,HostFilesystemSpaceLowreads a filesystem by its mountpoint, and a local-path volume reports no kubelet volume stats. The live check goes to a follow-up issue. [sources: k8s/README.md, k8s/monitoring/prometheus-values.yaml] - Should
devops k8s volume moveaccept the control-plane node as a target?: No. The README states why: the provisioner chooses the base directory from the node's own config, so the command cannot prove that the new volume is on the NVMe. (best practice) [sources: k8s/README.md, tests/k8s/test_k8s_volume_move.py]- Chosen: Keep the refusal and state the reason in the README. The command cannot prove the path, and the config that sets it lives in dan-petty/homelab.
- Rejected: Read ConfigMap
local-path-configand accept a node whose paths are all on the NVMe. The command would depend on a config of another repository and on a new setting for the NVMe base directory.
- Which storage classes does the check treat as local-path?:
local-pathandfast-nvme. Both use the local-path provisioner and differ only by reclaim policy. [sources: k8s/README.md]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-08: none.
Tool: none found.
Activity
dan-petty commentedon Nov 6, 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 test gap lets CNPG volumes land on the root disk unchecked, but the NVMe is already in place so no pod is currently at risk.Users gain a correct placement rule and a test that catches all claim owners on the control-plane node.The body estimates about 2 hours and 300,000 tokens across the test, README, check, and devops command.Both concern the Mattermost database on the control-plane node, but dan-petty/devops-cli#3647 moves that specific volume while the candidate updates the rule and test to cover CNPG Cluster resources.devops-cli-service commentedon Nov 7, 2026
Status set to Ready at dc276b0 (see proposed design in issue body).
Moved to new items: #3985.
devops-cli-service commentedon Nov 8, 2026
Alternatives check: none
Reason: The searches returned no open, maintained tool that reads this repository's Helm values files and manifests (StatefulSets and CloudNativePG
Clusterobjects) and asserts a control-plane node affinity per claim owner, nor one that carries the exemption table, the README rule or thedevops k8s volume movebehaviour. General policy engines and manifest linters only enforce whatever policy an author writes, so they would not replace the existing repository test and the issue itself states that no new tool is needed.Tool: none found
Lacks:
Clusterstorage class and affinity fields as this repository's check needsdevops k8s volume moveSearches run:
Checked on 2026-11-08. A person decides what this means for the item. The check changes no label and closes no issue.
1 remaining item
fix(k8s): Read each Cluster on a local-path class and name the item t…
devops-cli-service commentedon Nov 16, 2026
The runner Job devops-cli-implement-devops-cli-3782-be7cc0 ended: failed.
Image digest: sha256:1acb66a52294d3bec9d1496e1dd5bde98ebd99fe2da0f6b4bd1481b2c06c7fb4
The last lines of its log:
The kubelet evicted the pod of the Job: Usage of EmptyDir volume "home" exceeds the limit "8Gi".
Failure class:
limit_reached.Action taken: none.
Action left:
raise_limit: raise the limit that the run went over.The Job left this item without a result. The item is Blocked. When a retry can fix the class of the stop, the Service starts a new Job in the next round. The limit is
roadmap.implement.continuations_per_item, and the comment of that round says so. If no continuation is left, fix the cause. Then commentimplement: retry. A new runner image also clears the stop. This holds only if a retry can fix the class of the stop. The limits ofroadmap.implement.digest_clears_per_classandroadmap.implement.digest_clears_per_itemmust also allow it.devops-cli-service commentedon Nov 17, 2026
Released in v0.169.2: https://github.com/dan-petty/devops-cli/releases/tag/v0.169.2
devops-cli-service commentedon Nov 17, 2026
Live since 2026-11-17 01:11 UTC
fix(roadmap): Stop the false strength failure and log the volume use (#…
feat(k8s): check control-plane volumes avoid the k3s root disk (#7895)