Skip to content

feat(k8s): restart a pod's workload from the CLI and the dashboard #809

Closed as not planned

Description

@dan-petty

Context & Rationale

#686 asked for r to restart a pod. Three things stand in the way:

  • r is already Refresh (src/devops_cli/ui/dashboard.py:151).
  • The only restart in the CLI is devops argo rollouts restart, which works only on Argo Rollout objects (src/devops_cli/commands/argo.py:693-707, src/devops_cli/argo/rollouts.py:46). Nothing restarts Deployments, StatefulSets or DaemonSets.
  • Deleting a pod that has no controller loses the pod.

Scope & Deliverables

  • Deliverable:
    • devops k8s restart <namespace>/<pod> follows the pod's owner chain. For a pod owned by a ReplicaSet, it goes on to that ReplicaSet's Deployment or Argo Rollout; StatefulSets and DaemonSets own their pods directly.
      • A Deployment, StatefulSet or DaemonSet is rollout-restarted.
      • A Rollout is restarted through the existing restart_rollout.
      • A bare pod is refused.
      • --dry-run is supported.
    • A dashboard key with a confirmation dialog that calls the same function.
  • Acceptance criteria:
    • --dry-run names the owning workload and changes nothing.
    • A Rollout-owned pod goes through restart_rollout.
    • A bare pod is refused with a message.
    • The dashboard asks for confirmation before acting.
    • Tests fake the API.
  • Key questions:
    • Which key? R (proposed).
    • Refuse protected namespaces such as kube-system? Yes, through a constant (proposed).
  • Constraint: there is no restart without confirmation, and API calls run on worker threads.

Strategic Alignment

Update 2026-10-08: refinement

devops k8s push-secrets already restarts workloads (k8s/secret_push.py:643-657), so the command shares that function. '--dry-run names the owning workload' needs reads, which #412 forbids:

  • --dry-run makes no request and prints the planned reads and patch with <owner> placeholders.
  • The confirmation names the owning workload; declining sends nothing.

Activity

  1. added
    type/feature
    scope/k8s
    priority/p3-low
    on Oct 1, 2026
  2. dan-petty commented on Oct 8, 2026

    @dan-petty
    OwnerAuthor

    Linked: #807, #808 and #811. All four split from #686 and add to the Kubernetes tab's BINDINGS; this item proposes R, beside Refresh's r (ui/dashboard.py:181). Found by the 2026-10-08 backlog review.

  3. dan-petty commented on Oct 25, 2026

    @dan-petty
    OwnerAuthor

    Closed as not planned, 2026-10-25. The owner accepted the recommendation to use k9s for the Kubernetes functions of devops dashboard. The audit of the Kubernetes and Logs tabs is on #1885.

    k9s v0.51.0, which devops install-tools pins, covers this item. In the Deployment, StatefulSet and DaemonSet views, its Restart action does a rollout restart of the workload, and it asks for confirmation first. From a pod, its Jump Owner action opens the workload that owns the pod. devops argo rollouts restart restarts an Argo Rollout. A bare pod has no workload to restart, as this item says.

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

    priority/p3-lowscope/k8stype/feature

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions