Skip to content

fix(k8s): stateful local-path volumes bind on nodes with disk headroom instead of the control-plane node's 84%-full root disk #1634

Closed

Description

@dan-petty

Friction

Six of the ten bound local-path volumes, 60Gi claimed, sit on the control-plane node's 236 GB root disk, which is 83.8% used and growing, while the two other nodes have 1.9 TB disks at 13% and 17%. Nothing in git steers placement, local-path does not enforce claim sizes, and a local-path volume ties its pod to its node. At the observed growth the disk reaches the kubelet's 85% image-GC threshold in about two to three weeks; a slow-tier model change (an 18-20 GB pull) would bring it near DiskPressure, which would evict Prometheus, Loki and Grafana with nowhere to reschedule, on the node that also runs the API server. Planned items (#1391, #1135's Tempo claim, #1081) add more claims with no placement. Nine of the ten bound PVs are also reclaimPolicy Delete; Loki's Retain is a one-off hand patch.

Evidence

Live, read-only, 2026-10-17:

  • kubectl get pv: prometheus-server 20Gi, storage-loki-0 20Gi, grafana 5Gi, data-pyroscope-0 5Gi, qdrant-storage-qdrant-0 5Gi and open-webui 5Gi have node affinity to ; registry-data 50Gi, storage-prometheus-alertmanager-0, valkey-runs-data and roadmap-service-home are on one ; the third node holds none.
  • Prometheus 1 - node_filesystem_avail_bytes/node_filesystem_size_bytes{mountpoint="/"}: 0.838 (236.2 GB ext4 on LVM), 0.131 and 0.169 (about 1.97 TB each); the control-plane root grew from 0.8238 (2026-10-03) to 0.8364 (2026-10-17), about 0.13-0.24 GB a day.
  • /api/v1/nodes/<control-plane-node>/proxy/stats/summary: nodefs used 185.8 GB, available 38.3 GB, imagefs 17.9 GB. configz: imageGCHighThresholdPercent 85, imageGCLow 80, evictionHard nodefs.available 5%. No node reports DiskPressure.
  • ollama-48gib-slow runs on with hostPath /var/lib/ollama on that root filesystem; it is placed by Pascal GPU architecture (k8s/llm/profiles/ollama-profiles.yaml:639-646), so it cannot move by scheduling.
  • prometheus_tsdb_storage_blocks_bytes grew from 0.50 to 1.31 GB in a week toward retention: 30d/retentionSize: 16GB; Loki keeps 720h.
  • PV logging/storage-loki-0 is Retain by kubectl-patch (2026-10-03, the documented Metrics and logs are kept for two hours #550 rebind); the other nine bound PVs are Delete.

Repo:

  • No nodeSelector or affinity in the values for Prometheus, Loki, Grafana, Pyroscope, Qdrant or Open WebUI (grep -rn 'nodeSelector|affinity' k8s finds only the GPU-placed Ollama tiers, gpu-feature-discovery and dcgm-exporter-values.yaml:15).
  • k8s/README.md:293 (local-path pods "cannot move and wait for their node"); :149 (--addressing proxy reaches Grafana, Prometheus and Pyroscope only on the control-plane node); :213 (the Loki rebind procedure).
  • Alerts HostFilesystemSpaceLow (prometheus-values.yaml:246-247) and LogOrMetricVolumeDiskLow (:301) fire at 10% free, after image GC starts; with no Alertmanager receiver (feat(k8s): alertmanager posts critical and warning alerts to mattermost's alerts channel, and a roadmap service repository whose rounds all fail for an hour alerts #1392) nobody would see them.
  • The StorageClasses come from dan-petty/homelab k8s/manifests/local-path-storage.yaml (make storage), which has only local-path (Delete) and fast-nvme (Retain, placebo; homelab#6).

Remedy

  1. Node labels from git: a storage-role label on the large-disk nodes, set by the homelab repo's host configuration (dan-petty/homelab), not by hand.
  2. Tests first, then values: a test that every chart values file and manifest under k8s/ that requests a local-path claim also sets a nodeSelector or node affinity on that label (with a reviewed exemption list in src/devops_cli/config/constants.py for anything that must stay); then add the selector to Prometheus, Loki, Grafana, Pyroscope, Qdrant and Open WebUI, and require it in feat(k8s): mattermost team edition runs under argo cd from the mattermost operator, on a cloudnativepg database and a protected volume, at https://mattermost.<domain> through the tunnel #1391, feat(telemetry): traces are stored in tempo on a volume, and grafana and devops-cli read them, linked to logs and profiles #1135 and feat(k8s): the homelab runs gitea under argo cd as a read-write internal forge, served in-cluster over http and to workstations at https://git.<domain> through the cloudflare tunnel, with its admin secret pushed from the keyring #1081's claims.
  3. A Retain StorageClass in the homelab manifest, and the stateful charts point at it, so data does not depend on hand patches; the move in step 5 is the time to switch.
  4. Proxy addressing: update k8s/README.md:149 and --addressing proxy in the same change, since the services leave the control-plane node.
  5. Move the existing volumes with a documented copy-and-rebind per volume (scale to zero, copy, new claim on the target node, rebind; Loki with --cascade=orphan per README:213), run by a person.
  6. The slow tier's model store stays on the control-plane node (only Pascal GPU); free its root disk instead in the homelab repo (grow the logical volume if the volume group has room, or a separate disk for /var/lib/ollama).
  7. Add a warning at 85% used (the image-GC threshold) for nodes holding local-path volumes, in prometheus-values.yaml, with a test entry; it only reaches someone once feat(k8s): alertmanager posts critical and warning alerts to mattermost's alerts channel, and a roadmap service repository whose rounds all fail for an hour alerts #1392 lands.

Priority: P2. Severity medium: nothing is evicted today, but normal growth reaches image GC within weeks and the next model change or planned claim pushes toward DiskPressure on the control plane.

Proposed design

Problem statement

Local-path volumes are currently bound to the control-plane node's root disk, which is approaching the kubelet's 85% image-GC threshold. This situation risks eviction of critical services (Prometheus, Loki, Grafana) if disk pressure occurs, especially with planned increases in storage claims and model pulls.

Acceptance criteria

  • Criterion 1: Node labels are added to identify nodes with large disks for local-path volume placement
    Verification: Run kubectl get nodes --show-labels and verify that large-disk nodes have a new storage-role label
  • Criterion 2: Prometheus, Loki, Grafana, Pyroscope, Qdrant and Open WebUI charts are updated to use nodeSelector or node affinity on the new storage-role label
    Verification: Run helm template for each chart and verify that the generated manifests contain nodeSelector or nodeAffinity rules targeting the storage-role label
  • Criterion 3: Existing local-path volumes are moved from control-plane node to large-disk nodes using documented rebind procedure
    Verification: Run kubectl get pv before and after the move and verify that the PVs are now bound to the target nodes with no DiskPressure alerts
  • Criterion 4: A Retain StorageClass is implemented in the homelab manifest for stateful charts
    Verification: Run kubectl get sc and verify that a new StorageClass exists with Retain reclaimPolicy

Key questions

Fit

Needs splitting into 4 items:

  1. Add node labels to identify large-disk nodes
  2. Update charts to use nodeSelector or node affinity for local-path volumes
  3. Move existing volumes with documented rebind procedure
  4. Implement Retain StorageClass in homelab manifest

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    on Oct 18, 2026
  2. dan-petty commented on Oct 18, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Type: type/bug. The candidate describes a problem with incorrect disk usage and potential system instability due to volume placement.
    • Priority: P1-High. The issue poses a risk of system eviction and service disruption due to disk pressure on the control-plane node.
    • Value: High. Fixing the volume placement improves system stability and prevents potential outages for critical services like Prometheus, Loki, and Grafana.
    • Effort: Medium. The fix involves changes to node labels, chart values, storage classes, and potentially updating documentation and tests.
  3. dan-petty commented on Oct 18, 2026

    @dan-petty
    OwnerAuthor

    Proposal needs splitting into 4 items at 25e2cda (see proposed design in issue body).

  4. added a commit that references this issue on Oct 24, 2026
    dd083bb
  5. added a commit that references this issue on Oct 24, 2026
    3a00772
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

    source/agenttype/bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions