Skip to content

fix(k8s): skip ended pods in the volume move plan #7431

Done

Description

@dan-petty

Problem

devops k8s volume move finds the pods of a claim from the volumes of every pod in the namespace (_claim_pods, src/devops_cli/k8s/volume_move.py). It takes a pod that has ended (phase Succeeded or Failed) too. Such a pod does not hold the volume, and a scale of its Deployment to zero does not delete it, because it belongs to an old ReplicaSet with 0 replicas. The step "Scale ... to 0, and wait until these pods are gone" then waits for that pod until its timeout, and the move undoes its steps.

Evidence of 2026-11-27 on the homelab: namespace llm holds valkey-66c88d77b6-gkhz6 (phase Succeeded, node <control-plane>) next to the Running pod of Deployment valkey, and the same for valkey-devops. The node shutdown of a reboot ends pods in this way, and the pod garbage collection keeps them up to its threshold. The claim llm/valkey-data is one of the claims that dan-petty/homelab#469 moves to longhorn.

Change

_claim_pods leaves out a pod whose phase is Succeeded or Failed. The plan, the stop step and the check after the start then see only the pods that can hold the volume.

Acceptance criteria

  • A failing test first: a pod of the claim with phase Succeeded is not in the plan, and the stop step does not wait for it.
  • devops ci checks pass.

Related: #7382, dan-petty/homelab#469.

Activity

  1. added
    type/bug
    scope/k8s
    source/agent
    status/new
    value/medium
    effort/low
    on Nov 27, 2026
  2. dan-petty commented on Nov 27, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 27, 2026
  4. removed
    status/in-review
    owner/agent
    on Nov 27, 2026
  5. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-27 18:39 UTC

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/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions