Repository navigation
fix(k8s): put new stateful volumes on local-path-retain #6341
Description
Update 2026-11-26 (infra move): the environment volumes go to dan-petty/homelab.
This issue keeps k8s/devops/roadmap-service/pvc.yaml and the documents. k8s/devops/renovate/pvc.yaml is gone: Renovate runs from homelab. The other claims and the ignoreDifferences entry of Application devops are homelab work; that entry merges before the claim change here. local-path-retain is a homelab class: check how a minikube deploy gets it.
Follow-up: dan-petty/homelab#311.
Problem or Motivation
The stateful workloads of devops-cli ask for the StorageClass local-path, which has reclaimPolicy: Delete. Each new volume thus needs a hand patch to Retain, else the deletion of a claim deletes its data.
dan-petty/homelab now has the StorageClass local-path-retain (provisioner rancher.io/local-path, reclaimPolicy: Retain, volumeBindingMode: WaitForFirstConsumer). It came from homelab #14 (PR dan-petty/homelab#52, merged). #1634 step 3 planned this: "A Retain StorageClass in the homelab manifest, and the stateful charts point at it". #1634 closed on 2026-10-24, before the class existed.
Evidence (2026-11-18):
kubectl get pv: 8 bound volumes of classlocal-pathhave theDeletepolicy (namespacesdevops,llm,monitoring,oteland one demo namespace). The other bound volumes areRetainby hand patches.storageClassName: local-pathis in 11 places ofk8s/:k8s/devops/renovate/pvc.yaml,k8s/devops/roadmap-service/pvc.yaml,k8s/gitea/values.yaml,k8s/llm/gateway-db.yaml,k8s/mattermost/database.yaml,k8s/mattermost/files-pvc.yaml,k8s/monitoring/grafana-values.yaml,k8s/monitoring/k8s-monitoring-values.yaml,k8s/monitoring/prometheus-values.yaml(2),k8s/monitoring/pyroscope-values.yamlandk8s/otel/tempo-values.yaml.
Proposed Solution & Architectural Design
Set local-path-retain for the stateful workloads of devops-cli, for new volumes only. A bound volume keeps its class.
Constraints to design for:
- The API server refuses a change of
storageClassNameon a bound claim, and a change of thevolumeClaimTemplatesof a StatefulSet. A plain edit of the 11 places can thus break the Argo CD sync of the claims that exist. The change must keep that sync healthy, for example with the new class only where no claim exists yet, or with anignoreDifferencesentry for the field. - The reclaim policy of a bound PersistentVolume can change. A documented
kubectl patch pv <name> -p '{"spec":{"persistentVolumeReclaimPolicy":"Retain"}}'step for the 8Deletevolumes removes the risk of today. - Document the class in
k8s/README.mdand indocs/SERVICE_PATTERNS.mdfor each new stateful workload.
Target Subsystem
Kubernetes manifests and Helm values (k8s/).
Existing Tool Considered
The local-path-retain StorageClass of homelab and the reclaimPolicy of Kubernetes. No new tool.
Acceptance Criteria
- Each stateful workload of
k8s/getslocal-path-retainfor a new volume, and the Argo CD sync of each existing claim stays healthy. - After the sync,
kubectl get pvshows no bound volume of a devops-cli workload with theDeletepolicy. -
k8s/README.mdnames the class for new stateful workloads.
Alternatives check of 2026-11-27: covers.
Tool: rancher/local-path-provisioner (https://github.com/rancher/local-path-provisioner), Apache-2.0, last activity 2026-11-27, maintained.
Reason: Searches found the local-path provisioner already in use as the provisioner behind the cluster's classes; the issue asks only for a StorageClass with Retain policy, which this tool serves, and no ADR rejects it.
Covers:
- Dynamic hostPath or local PV provisioning on each node
- Backs a StorageClass whose provisioner is rancher.io/local-path
- Configurable node path map with setup and teardown scripts
Lacks:
- Reclaim policy comes from the StorageClass and PV, not the provisioner
- Cannot change storageClassName on an already bound claim
- No capacity limit; bound Delete volumes need a separate patch
Proposed design
Problem statement
The product-base stateful claims under k8s/devops — the roadmap Service home volume and the valkey-roadmap data volume — name StorageClass local-path, whose reclaim policy is Delete, so deleting a claim deletes its data. The homelab cluster has local-path-retain, which keeps the data. This change points both claims at that class for a new volume, adds a k8s gate check that refuses local-path under k8s/devops, and documents the class and the minikube step. A bound claim keeps its class; #6752 patches the bound Delete volumes.
Acceptance criteria
Requirement: The roadmap Service claim uses the Retain class
The PersistentVolumeClaim k8s/devops/roadmap-service/pvc.yaml SHALL set spec.storageClassName to local-path-retain.
Scenario: The k8s row accepts the roadmap Service claim
- WHEN A person runs
uv run devops ci --check --only k8s. - THEN The row passes and its
check_every_devops_claim_names_the_retain_classcheck reports the claimroadmap-service-homeonlocal-path-retain.
Requirement: The valkey-roadmap claim uses the Retain class
The valkey-data PersistentVolumeClaim patch in k8s/devops/valkey-roadmap/kustomization.yaml SHALL set storageClassName to local-path-retain.
Scenario: The k8s row accepts the rendered valkey claim
- WHEN A person runs
uv run devops ci --check --only k8s. - THEN The row passes and its
check_every_devops_claim_names_the_retain_classcheck reports the rendered valkey claim onlocal-path-retain.
Requirement: The k8s gate refuses local-path in a devops claim
The k8s row MUST fail when a PersistentVolumeClaim under k8s/devops/ names local-path.
Scenario: The gate fails on the old class
- WHEN A person sets
storageClassName: local-pathink8s/devops/roadmap-service/pvc.yamland runsuv run devops ci --check --only k8s. - THEN The row fails and the
check_every_devops_claim_names_the_retain_classcheck namesk8s/devops/roadmap-service/pvc.yamlandlocal-path.
Requirement: The k8s README names the Retain class
k8s/README.md SHALL name local-path-retain as the class for a new stateful volume.
Scenario: The k8s row finds the class in the README
- WHEN A person runs
uv run devops ci --check --only k8s. - THEN The row passes and its
check_the_k8s_readme_names_the_retain_classcheck findslocal-path-retainin the storage prerequisite ofk8s/README.md.
Requirement: The k8s README documents the minikube class
k8s/README.md SHALL give the kubectl apply step that creates local-path-retain on minikube with reclaimPolicy: Retain and volumeBindingMode: WaitForFirstConsumer.
Scenario: The k8s row finds the minikube step
- WHEN A person runs
uv run devops ci --check --only k8s. - THEN The row passes and its
check_the_k8s_readme_names_the_retain_classcheck finds thekubectl applystep and both fields in the minikube part ofk8s/README.md.
Requirement: The service pattern requires the Retain class
docs/SERVICE_PATTERNS.md SHALL require a StorageClass with reclaimPolicy: Retain for a new stateful workload and SHALL name local-path-retain as the class of the product base.
Scenario: The k8s row finds the service-pattern rule
- WHEN A person runs
uv run devops ci --check --only k8s. - THEN The row passes and its
check_the_service_patterns_name_the_retain_classcheck finds the Retain rule andlocal-path-retainindocs/SERVICE_PATTERNS.md.
Requirement: The change stays in the product base
The branch MUST change no path under k8s/ outside k8s/devops/.
Scenario: The k8s row accepts the branch
- WHEN A person runs
uv run devops ci --check --only k8s. - THEN The row passes and its
check_the_repository_tracks_no_environment_filecheck reports no tracked file underk8s/outsidek8s/devops/and no non-Markdown file there.
Requirement: Pending a person after the merge
A person SHALL apply the documented StorageClass manifest on a minikube cluster before a deploy whose claims name local-path-retain.
Scenario: The minikube cluster serves the Retain class
- WHEN After the merge, a person runs the
kubectl applystep ofk8s/README.mdon minikube and thenkubectl get storageclass local-path-retain -o jsonpath='{.reclaimPolicy} {.volumeBindingMode}'. - THEN The command prints
Retain WaitForFirstConsumer.
Existing Tool Considered
The alternatives block of 2026-11-27 records the verdict covers for rancher/local-path-provisioner (Apache-2.0, maintained); its Lacks: list is the block for what the tool does not cover. The provisioner is the one behind the cluster's local-path and local-path-retain classes, so the change keeps it and builds no storage tool: it points the two product-base claims at the Retain class, adds the k8s gate check that refuses local-path under k8s/devops/, and documents the class and the minikube step. #6752 patches the bound Delete volumes, and the homelab change adds the Argo CD ignoreDifferences entry.
Key questions
- The alternatives check found that
https://github.com/rancher/local-path-provisionercovers this item. Adopt the tool, or keep the item and give the reason.: Keep the item and use the provisioner that the cluster'slocal-pathandlocal-path-retainclasses already run. The alternatives block records the verdictcovers, and itsLacks:list holds what the tool does not do. The change adds no storage tool: it points the two product-base claims at the Retain class and adds the k8s gate check. (best practice) [sources: openspec/changes/archive/2026-11-06-2570-minikube-starts-with-no-local-path/proposal.md:52, k8s/README.md:34]- Chosen: Keep rancher/local-path-provisioner. The classes of the cluster run it, the alternatives block records
covers, and the change needs only the Retain class and the gate check. - Rejected: Build a storage provisioner or a class controller. The open tool covers the need, so AGENTS.md rule 3 refuses the build.
- Rejected: Replace it with another provisioner. No ADR or issue names one, and the cluster's classes use
rancher.io/local-path.
- Chosen: Keep rancher/local-path-provisioner. The classes of the cluster run it, the alternatives block records
- Which StorageClass should a new stateful volume use?: Use
local-path-retain. It hasreclaimPolicy: RetainandvolumeBindingMode: WaitForFirstConsumer. A new volume then keeps its data. (best practice) [sources: k8s/README.md:340]- Chosen: local-path-retain. The homelab class sets the Retain policy and the WaitForFirstConsumer binding.
- Rejected: local-path. Its reclaim policy is Delete, which deletes the data with the claim; that is the defect that this change removes.
- Rejected: longhorn. It is the replicated CSI class of the volume-move path, not the local class of these single-node volumes.
- Which claims under
k8s/devopsdoes this repository hold?: This repository holds two claims underk8s/devops: the claimroadmap-service-homeink8s/devops/roadmap-service/pvc.yaml, and thevalkey-dataPersistentVolumeClaim thatk8s/devops/valkey-roadmap/kustomization.yamlpatches from the shared Valkey base. [sources: k8s/devops/roadmap-service/pvc.yaml:14, k8s/devops/valkey-roadmap/kustomization.yaml:81, docs/CLUSTER.md:306] - How does the Argo CD sync of a bound claim stay healthy when its manifest names a new class?: The homelab Application
devopsholds theignoreDifferencesentry forspec.storageClassName, and that entry merges before this change. The API server refuses the field on a bound claim, so the live claim keeps its class and the manifest applies to a new claim only. (best practice) [sources: k8s/README.md:134]- Chosen: ignoreDifferences in the homelab Application. The API server refuses the field on a bound claim, and the live claim keeps its class.
- Rejected: Recreate the claim in this change. It is a live data step with downtime, and no manifest change can do it.
- Rejected: Keep the claim on local-path. A new claim would still get a Delete volume.
- How does a minikube deploy get
local-path-retain?: Thestorage-provisioner-rancheraddon provides onlylocal-path. A person applies a StorageClass manifest namedlocal-path-retainwith provisionerrancher.io/local-path,reclaimPolicy: RetainandvolumeBindingMode: WaitForFirstConsumerbefore the deploy.k8s/README.mdgives thekubectl applystep. (best practice) [sources: k8s/README.md:34, docs/DEVCONTAINER_USAGE.md:451, openspec/changes/archive/2026-11-06-2570-minikube-starts-with-no-local-path/proposal.md:52]- Chosen: Document a one-time kubectl apply in k8s/README.md. The class is a homelab class, the product base owns no copy of it, and kubectl is the existing tool.
- Rejected: Add the StorageClass to k8s/devops and deploy it with Application devops. It would give the homelab class a second owner and conflict with the class that dan-petty/homelab manages.
- Rejected: Create the class in the minikube start command of devops-cli. It changes the product command for a class that the environment owns, and the issue targets the manifests and the documents.
- Where do the documents go?:
k8s/README.mdnameslocal-path-retainfor a new stateful volume and gives the minikubekubectl applystep.docs/SERVICE_PATTERNS.mdadds a state row that requires a Retain class for a new stateful workload and nameslocal-path-retainas the class of the product base. (best practice) [sources: CONTEXT.md:309, openspec/changes/archive/2026-11-16-6059-service-patterns/design.md:5, docs/SERVICE_PATTERNS.md:82]- Chosen: Name the class in both documents. The issue asks for the class in both, and
docs/SERVICE_PATTERNS.mdis a project profile that names the workloads of this cluster. - Rejected: Put only a generic Retain rule in docs/SERVICE_PATTERNS.md. The issue asks to document the class there, and that file is not a guideline under
docs/guidelines/, so it may name a class of this environment. - Rejected: Name the class only in k8s/README.md. The issue also names
docs/SERVICE_PATTERNS.md.
- Chosen: Name the class in both documents. The issue asks for the class in both, and
- Does the manifest change affect a bound volume?: No. The API server refuses a change of
spec.storageClassNameon a bound claim, so a bound volume keeps its class and reclaim policy. The change applies to a new claim only. The separate item fix(k8s): patch bound Delete volumes and recreate StatefulSets #6752 patches the bound Delete volumes. [sources: k8s/README.md:134, k8s/devops/roadmap-service/pvc.yaml:14, openspec/changes/archive/2026-11-23-6752-patch-bound-delete-volumes-and-recreate/proposal.md:7] - How does the change keep a new claim off
local-path?: Addcheck_every_devops_claim_names_the_retain_classto thek8srow. It reads the render ofk8s/devopsand fails when a PersistentVolumeClaim nameslocal-path. (best practice) [sources: AGENTS.md:17, tests/gate/k8s.py:4, docs/TESTING.md:61]- Chosen: Add a k8s gate check. AGENTS rule 11 asks for a check that fails if the problem returns, and the k8s row already checks the committed manifests.
- Rejected: Rely on review only. A review rule does not fail a pull request.
- Rejected: Add a pytest test that reads the manifest. docs/TESTING.md:61 refuses a test that asserts a value of a manifest; the k8s row is the place for that check.
Open questions
- The alternatives check found that
https://github.com/rancher/local-path-provisionercovers this item. Adopt the tool, or keep the item and give the reason. (a person decides)
Fit
Fits in one pull request.
Suspected block
The homelab pull request dan-petty/homelab#311 adds the ignoreDifferences entry for Application devops; it must merge before this claim change reaches the cluster.
Dependencies
None.
Activity
dan-petty commentedon Nov 18, 2026
Both configure the local-path StorageClass in k8s/ manifests, but 2570 adds the class to minikube while the candidate switches workloads to the Retain variant.devops-cli-service commentedon Nov 19, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.
devops-cli-service commentedon Nov 22, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (5)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 22, 2026
Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.
dan-petty commentedon Nov 23, 2026
Since step 11 of docs/HOMELAB_REPO_SWITCH.md (#6820), Argo CD reads the homelab environment from dan-petty/homelab. The k8s/ paths outside k8s/devops are frozen and rejected by the k8s gate (check_the_branch_changes_no_environment_path). The stateful workload StorageClass changes and Argo CD ignoreDifferences belong in a pull request to dan-petty/homelab, while devops-cli only holds k8s/devops (renovate and roadmap-service).
devops-cli-service commentedon Nov 23, 2026
Owner question: See Suspected block in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
fix(k8s): add Local-Path Retain Migration runbook to k8s/README.md (#…
devops-cli-service commentedon Nov 27, 2026
Owner question: See Suspected block in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 27, 2026
The result in the alternatives block of the issue body changed. Before this check:
in-use, tool https://github.com/rancher/local-path-provisioner. A person decides what the new result means for the item.Searches (4)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 28, 2026
Owner question: See the first point of Open questions in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence