Repository navigation
Description
Problem
The volume of claim mattermost/mattermost-db-1 stays on the control-plane node after #2147 moves the volumes of Grafana, the Prometheus server and Loki. #1634 asks to move every local-path volume off that node. No check sees this volume, and no tool moves it:
kubectl get pvon 2026-11-05 shows this volume, classlocal-path, reclaim policyRetain, bound to the control-plane node.k8s/mattermost/database.yamlhasinstances: 1, no node affinity and no backup. The live Cluster hasbackupunset, andaffinityholds onlypodAntiAffinityType: preferred.tests/core/test_k8s_local_path_placement.pyhas"cloudnative-pg": ()inCHART_CLAIMS, and its manifest check does not read apostgresql.cnpg.ioCluster. So the placement test passes with this volume on that node.devops k8s volume move mattermost/mattermost-db-1 --planrefuses: "Pod mattermost-db-1 belongs to Cluster mattermost-db. The move can stop and start only a Deployment or a StatefulSet."
Expected
The volume of the Mattermost database is on a worker node, the data is complete, and the placement test fails when a CloudNativePG Cluster on a claim can run on the control-plane node.
Acceptance criteria
-
kubectl get pvshows the volume of the database on a worker node, and Mattermost reads its data after the move. -
k8s/mattermost/database.yamlsets the required node affinity withnode-role.kubernetes.io/control-planeDoesNotExistunderspec.affinity.nodeAffinity. -
tests/core/test_k8s_local_path_placement.pyreads the CloudNativePG Cluster manifests, and fails when such an affinity is missing. - The move has a backup of the database first, and a person runs the steps that change the cluster.
Existing tool considered
CloudNativePG can make a new instance on another node through a replica or a restore from a backup, with spec.affinity on the Cluster. Use this procedure of the operator. Do not extend devops k8s volume move for this, because the operator owns the pods and the claim of the Cluster.
Related
Proposed design
Problem statement
The claim mattermost/mattermost-db-1 stays on the control-plane node. tests/core/test_k8s_local_path_placement.py has "cloudnative-pg": () in CHART_CLAIMS and reads no postgresql.cnpg.io Cluster, so the placement test passes with this volume on that node. This change makes the placement test read CloudNativePG Cluster manifests and fail when a Cluster on a claim can run on the control-plane node. The live move of the database needs a backup and a person. The manifest affinity would make the pod unschedulable before the move. This issue defers both to a new issue.
Acceptance criteria
Requirement: The check reads a CloudNativePG Cluster
The placement check SHALL treat a postgresql.cnpg.io/v1 Cluster document that sets spec.storage as a pod on a claim, and read its affinity from spec.affinity.
Scenario: A Cluster without the control-plane term
- WHEN a test passes a Cluster document with
spec.storageand aspec.affinitythat has nonode-role.kubernetes.io/control-planeDoesNotExistterm in every required term - THEN the check reports the Cluster as a pod on a claim that does not keep off the control-plane node
Requirement: A Cluster with the term passes the check
The placement check SHALL accept a CloudNativePG Cluster whose spec.affinity holds the DoesNotExist term in every term of nodeSelectorTerms.
Scenario: A Cluster with the required term
- WHEN a test passes a Cluster document with
spec.storageandspec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTermsthat each hold the term - THEN the check reports the Cluster as a pod on a claim that keeps off the control-plane node
Requirement: The expected manifest pods name the Cluster
EXPECTED_MANIFEST_PODS MUST name k8s/mattermost/database.yaml:Cluster/mattermost-db, so that a wrong path cannot pass by finding nothing.
Scenario: The check runs on the repository tree
- WHEN
test_every_manifest_pod_on_a_claim_keeps_off_the_control_plane_noderuns - THEN the test reports no missing expected manifest pod
Requirement: The Mattermost Cluster is exempt until the move
_CONTROL_PLANE_CLAIM_EXEMPTIONS SHALL hold k8s/mattermost/database.yaml:Cluster/mattermost-db with a reason that names the deferred issue, until the database moves.
Scenario: The exemption is valid and the test passes
- WHEN
test_every_exemption_names_a_pod_on_a_claim_that_stays_on_any_nodeandtest_every_manifest_pod_on_a_claim_keeps_off_the_control_plane_noderun - THEN the check finds the Cluster, its affinity does not keep off the control-plane node, and the placement test reports no failure
Existing Tool Considered
No alternatives check has run. CloudNativePG covers the need: the operator applies spec.affinity to the database pods, and it can make an instance on a worker node from a replica or a restore. It lacks a command that moves the claim of an existing single-instance Cluster to another node, so a person must run the move with a backup. devops k8s volume move does not cover the need: the operator owns the pods and the claim, and the tool refuses the move.
Key questions
- Which manifest holds the claim of the Mattermost database?:
k8s/mattermost/database.yamlholds Clustermattermost-dbin namespacemattermost, withspec.storage.storageClass: local-path,spec.storage.size: 10Giandspec.instances: 1. [sources: k8s/mattermost/database.yaml] - Does the check need an entry in
CHART_CLAIMSfor thecloudnative-pgchart?: No. Thecloudnative-pgchart installs the operator and mounts no claim. The claim of the database comes from Clustermattermost-db, which is a manifest, so the check reads it as a manifest pod. [sources: tests/core/test_k8s_local_path_placement.py, k8s/mattermost/database.yaml] - How does the placement check read the node affinity of a CloudNativePG Cluster?: Read
spec.affinityof eachpostgresql.cnpg.io/v1Cluster that setsspec.storage, and pass it tokeeps_off_the_control_plane. (best practice) [sources: tests/core/test_k8s_local_path_placement.py, k8s/mattermost/database.yaml, tests/support/k8s_tree.py]- Chosen: Read
spec.affinityof the Cluster. The operator appliesspec.affinityto the database pods, and the existing check reads an affinity object. - Rejected: Extend
devops k8s volume move. The operator owns the pods and the claim, so the tool refuses the move. - Rejected: Render the CloudNativePG chart and read its pods. The check reads files only and renders no chart.
- Chosen: Read
- How does the placement test pass until the database moves?: Add
k8s/mattermost/database.yaml:Cluster/mattermost-dbto_CONTROL_PLANE_CLAIM_EXEMPTIONSwith a reason that names the deferred issue. The exemption test fails when the entry goes stale, so the deferred issue removes it. (best practice) [sources: tests/core/test_k8s_local_path_placement.py, k8s/README.md:356]- Chosen: Exempt the Cluster with a reason. The check sees the Cluster, and the exemption test forces its removal after the move.
- Rejected: Add the affinity to the manifest now. The claim is on the control-plane node, so the pod would stay Pending and Mattermost would stop.
- Rejected: Leave CloudNativePG out of the check. No check would see this volume, which is the defect.
- How does a test prove the Cluster reading without a render?: Pass a literal Cluster document to the manifest check, and assert the result for an affinity with and without the
DoesNotExistterm. (best practice) [sources: tests/core/test_k8s_local_path_placement.py]- Chosen: A literal Cluster document in a unit test. The test runs offline and pins the
spec.storageandspec.affinitypaths. - Rejected: A temporary
k8s/tree on disk. It writes files, and the helpers read the real tree only.
- Chosen: A literal Cluster document in a unit test. The test runs offline and pins the
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-07: in-use.
The item already names this tool.
Tool: cloudnative-pg/cloudnative-pg (https://github.com/cloudnative-pg/cloudnative-pg), Apache-2.0, last activity 2026-11-07, maintained.
Activity
devops-cli-service commentedon Nov 5, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
The control-plane disk is near full and this is a database volume, but it is one of several volumes to move and no outage is active.Requires setting node affinity, updating the placement test for CloudNativePG Clusters, taking a backup, and running a manual move procedure.Both move a local-path volume off the control-plane node under dan-petty/devops-cli#1634, but target different services and different manifests.devops-cli-service commentedon Nov 6, 2026
Status set to Ready at 6d12548 (see proposed design in issue body).
Moved to new items: dan-petty/homelab#333.
devops-cli-service commentedon Nov 7, 2026
Alternatives check: in-use
Reason: The web searches returned no provider answer, so the check rests on the facts read for cloudnative-pg/cloudnative-pg and on the issue's own account of the operator. CloudNativePG is already the tool the issue names and uses: the operator applies
spec.affinityto the database pods and can make an instance on a worker node from a replica or a restore, but it has no command that moves the local-path claim of the existing single-instance Cluster, so a person must take a backup and run the move.The item already names this tool.
Tool: cloudnative-pg/cloudnative-pg (https://github.com/cloudnative-pg/cloudnative-pg)
Covers:
spec.affinityto the database pods, so a Cluster can require a worker node withnode-role.kubernetes.io/control-planeDoesNotExistspec.affinityof thepostgresql.cnpg.io/v1Cluster, which the placement check can inspectLacks:
local-pathclaim with reclaim policyRetainstays on the control-plane node until a person runs the backup and the movetests/core/test_k8s_local_path_placement.pyread a Cluster manifest and fail on a missing control-plane term; that check is this repository's own workTools considered:
Searches run:
Sources:
Checked on 2026-11-07. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 9, 2026
Staged: branch
fix/3647-move-the-mattermost-database-off-the, draft pull request #4268. 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 default branch changed these paths that the plan names, after the commit that the planner read. Read the commits before you judge the plan:
k8s/README.md: aea5adc fix(roadmap): keep refused stage replies, stop placeholder replies (fix(roadmap): keep refused stage replies, stop placeholder replies #4260)A model review of the plan found these points. They stop no draft, and a person judges them:
otherat group 2: Group 2 replaces the whole exemption paragraph ofk8s/README.mdwith the two entries, so it drops the rule that tells a person to move the volume and then remove the entry and add the affinity. The plan says it keeps the move procedure, but that rule is not the move procedure and no task keeps it. Evidence: "Move the volume as below. Then remove its entry and add the affinity to its values in one pull request."otherat pull_request_body and group 2: The plan says the gateway Cluster's exemption reason names the item that moves it, but fix(k8s): the placement rule fits the NVMe and covers CNPG clusters #3782 is the placement rule and the CNPG coverage of the test; the plan's own feasibility says fix(k8s): the placement rule fits the NVMe and covers CNPG clusters #3782 reads Clusters in the test and the README, so the reason does not name a move ofllm-gateway-db. Evidence: "fix(k8s): the placement rule fits the NVMe and covers CNPG clusters"The runs of the planner and the review made 70 model request(s), and used 6307049 input tokens and 122460 output tokens. The tool calls, in order:
read_spec({"capability":"local-path-volume-placement"})read_issue({"number":1634})read_issue({"number":2147})find_issues({"terms":"mattermost-db control plane"})search_code({"text":"postgresql.cnpg.io"})read_issue({"number":3782})read_issue({"number":3803})read_file({"path":"tests/invariants/test_k8s_manifests.py","start_line":830,"end_line":910})read_file({"path":"k8s/mattermost/database.yaml"})read_file({"path":"k8s/llm/gateway-db.yaml","start_line":55,"end_line":100})read_file({"path":"k8s/README.md","start_line":365,"end_line":392})search_code({"text":"ci docs"})file_symbols({"path":"tests/core/test_k8s_local_path_placement.py"})search_code({"text":"_CONTROL_PLANE_CLAIM_EXEMPTIONS"})search_code({"text":"EXPECTED_MANIFEST_PODS"})read_file({"path":"tests/core/test_k8s_local_path_placement.py","start_line":26,"end_line":36})list_files({"directory":""})read_file({"path":"tests/core/test_k8s_local_path_placement.py"})read_file({"path":"tests/core/test_k8s_local_path_placement.py","start_line":158,"end_line":400})read_file({"path":"k8s/README.md","start_line":350,"end_line":420})read_spec({"capability":"local-path-volume-placement"})read_issue({"number":3803})read_issue({"number":3782})search_code({"text":"ci docs"})list_files({"directory":"src/devops_cli/commands/ci"})read_file({"path":"docs/commands/ci.md","start_line":1,"end_line":220})search_code({"text":"postgresql.cnpg.io"})search_code({"text":"cnpg"})read_spec({"capability":"local-path-volume-placement","requirement":"A pod that mounts a claim does not run on the control-plane node"})read_file({"path":"tests/invariants/test_k8s_manifests.py","start_line":830,"end_line":900})read_file({"path":"docs/roadmap/plan-recheck.md"})read_file({"path":"docs/roadmap/plan-check.md"})search_code({"text":"SPEC_DELTA"})search_code({"text":"spec_delta"})search_code({"text":"def check_spec_delta"})search_code({"text":"skip_specs"})search_code({"text":"def docs"})search_code({"text":"REGENERATE_DOCUMENTS"})read_file({"path":"src/devops_cli/commands/ci.py","start_line":2120,"end_line":2210})search_code({"text":"\"docs\":"})search_code({"text":"get_check_spec"})search_code({"text":"sync_readme"})search_code({"text":"def get_check_specs"})read_file({"path":"src/devops_cli/commands/ci.py","start_line":727,"end_line":860})search_code({"text":"k8s/README.md"})read_issue({"number":1634})read_issue({"number":2147})read_file({"path":"k8s/llm/gateway-db.yaml","start_line":60,"end_line":100})read_file({"path":"tests/gate/k8s_checks/gateway_database.py"})references({"name":"3782"})references({"name":"3803"})find_issues({"terms":"mattermost-db control plane"})find_issues({"terms":"local-path placement"})read_file({"path":"src/devops_cli/commands/docs.py","start_line":60,"end_line":140})read_file({"path":"src/devops_cli/docs/generator.py","start_line":1380,"end_line":1440})search_code({"text":"def spec_delta_problems"})search_code({"text":"SPEC_DELTA"})search_code({"text":"skip_specs"})search_code({"text":"ProposalGate"})search_code({"text":"def _spec_delta_problems"})search_code({"text":"stage_problem_spec"})read_file({"path":"src/devops_cli/roadmap/stage/stage_change.py","start_line":740,"end_line":860})search_code({"text":"def _verify_problems"})search_code({"text":"stage_problem_verify"})read_file({"path":"src/devops_cli/roadmap/stage/stage_form.py"})search_code({"text":"def verification_problem"})read_file({"path":"src/devops_cli/roadmap/implement/implement_shell_policy.py","start_line":440,"end_line":540})search_code({"text":"ci test"})search_code({"text":"class GroupKind"})read_file({"path":"src/devops_cli/roadmap/stage/stage_change.py","start_line":430,"end_line":520})search_code({"text":"def _other_problems"})read_file({"path":"src/devops_cli/roadmap/stage/stage_change.py","start_line":520,"end_line":600})read_issue({"number":3985})search_code({"text":"mattermost-db"})search_code({"text":"weakened_checks"})search_code({"text":"def criterion_problems"})read_file({"path":"src/devops_cli/roadmap/stage/stage_criteria.py","start_line":180,"end_line":290})search_code({"text":"class StageCriterion"})read_file({"path":"src/devops_cli/roadmap/stage/stage_criteria.py","start_line":40,"end_line":120})search_code({"text":"def select_tests_for_sources"})read_file({"path":"src/devops_cli/core/test_selection.py","start_line":440,"end_line":560})search_code({"text":"gateway-db.yaml"})list_files({"directory":"k8s/argocd/apps"})search_code({"text":"3647"})list_files({"directory":"k8s/llm"})read_file({"path":"k8s/mattermost/database.yaml"})search_code({"text":"citation"})search_code({"text":"stage_problem_citation"})read_file({"path":"src/devops_cli/roadmap/stage/stage_change.py","start_line":1180,"end_line":1310})search_code({"text":"def _dependencies_problems"})search_code({"text":"stage_problem_dependencies"})read_file({"path":"src/devops_cli/roadmap/stage/stage_change.py","start_line":1920,"end_line":2010})find_issues({"terms":"test_k8s_local_path_placement"})find_issues({"terms":"CNPG"})search_code({"text":"NOT_IN_RUNNER"})read_file({"path":"src/devops_cli/roadmap/runner_tools.py","start_line":1,"end_line":160})read_file({"path":"src/devops_cli/roadmap/runner_tools.py","start_line":160,"end_line":260})search_code({"text":"_ISSUE_DEPENDENCY"})search_code({"text":"def code_span_paths"})read_file({"path":"src/devops_cli/roadmap/stage/stage_paths.py","start_line":160,"end_line":230})read_file({"path":"openspec/changes/archive/2026-11-06-2147-the-volumes-of-grafana-the-prometheus/proposal.md"})read_file({"path":"src/devops_cli/roadmap/stage/stage_paths.py","start_line":1,"end_line":80})Tool calls: file_symbols=1 (empty=0), find_issues=5 (empty=1), list_files=4 (empty=0), read_file=34 (empty=0), read_issue=9 (empty=0), read_spec=3 (empty=0), references=2 (empty=0), search_code=44 (empty=4)
The stage job read the open pull requests and their files in 1 GraphQL request(s).
docs(openspec): plan #3647 Read CNPG Clusters in the placement test
docs(openspec): plan #3647 Read CNPG Clusters in the placement test
2 remaining items
fix(k8s): Read CloudNativePG Clusters in the placement test (#3647)
fix(k8s): State the Cluster rule and the two exemptions in k8s/README…
docs(openspec): archive the change (#3647)
devops-cli-service commentedon Nov 10, 2026
Pull request #4304 is ready for review. The checks passed.
Spend: 51 model requests, 1884675 input tokens, 16953 output tokens.
devops-cli-service commentedon Nov 10, 2026
Released in v0.103.2: https://github.com/dan-petty/devops-cli/releases/tag/v0.103.2
devops-cli-service commentedon Nov 10, 2026
Live since 2026-11-10 01:00 UTC