digitalocean / digitalocean/doctl

doctl kubernetes cluster delete should warn about running workloads before destroying a cluster

Open
#1,875 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
3.4k
Forks
496
Avg merge
1d 2h
Merged PRs (30d)
31

Description

doctl kubernetes cluster delete prompts for confirmation with a generic "are you sure?" message (or skips it entirely with --force), then immediately destroys the cluster regardless of
what's running on it.

Expected behavior:

Before deletion, doctl should query the cluster and display a summary of running workloads, e.g.:

Warning: Cluster "my-cluster" has the following active workloads:

Namespaces: 5
Running Pods: 47
Services (LoadBalancer): 3
PersistentVolumeClaims: 8

Are you sure you want to delete this cluster? This action is irreversible. [y/N]

This gives the operator a chance to see that a cluster is not empty before confirming deletion.

Why this matters:

Deleting a cluster with active workloads (deployments, statefulsets, load balancers, persistent volumes) is a destructive and irreversible action. Other cloud CLIs (e.g., gcloud, eksctl)
surface warnings or require additional flags when destroying clusters with running resources. doctl should provide similar guardrails.

Steps to reproduce:

1. Have a DOKS cluster with running pods/services
2. Run doctl kubernetes cluster delete
3. Confirm deletion
4. Cluster is destroyed with no indication of what was running on it

Environment:
- doctl version: (any current version)
- OS: Linux

Contributor guide

Open the contributing guide

Research direction

Start at the doctl kubernetes cluster delete command and inspect its existing confirmation and --force paths, then determine how the cluster can be queried for active workloads. Done means deletion warns with a workload summary before confirmation while preserving the documented irreversible-delete behavior and --force path; exercise the command against a cluster with running pods and services.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
cli, cloud, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.