Delete a Cluster
Request
Section titled “Request”DELETE /api/v1/tenants/{tenant}/clusters/{name}export KUPE_TENANT="<tenant>"export KUPE_CLUSTER="staging"
curl -X DELETE \ -H "Authorization: Bearer $KUPE_API_KEY" \ "https://api.kupe.cloud/api/v1/tenants/$KUPE_TENANT/clusters/$KUPE_CLUSTER"Returns 204 No Content on success. The cluster enters a Deleting phase and is fully
removed asynchronously by the platform operator.
See Reference: delete cluster for the full schema.
Verify deletion completes
Section titled “Verify deletion completes”If you need to know when the cluster has been fully removed (for example, before reusing
the same name), poll the GET endpoint until it returns 404 Not Found:
export KUPE_TENANT="<tenant>"export KUPE_CLUSTER="staging"
TIMEOUT_SECONDS=300INTERVAL=5ELAPSED=0
while [ "$ELAPSED" -lt "$TIMEOUT_SECONDS" ]; do STATUS=$(curl -s -o /dev/null -w "%{http_code}" \ -H "Authorization: Bearer $KUPE_API_KEY" \ "https://api.kupe.cloud/api/v1/tenants/$KUPE_TENANT/clusters/$KUPE_CLUSTER")
if [ "$STATUS" = "404" ]; then echo "Cluster deleted" exit 0 fi
echo "Still deleting (HTTP $STATUS, elapsed ${ELAPSED}s)" sleep "$INTERVAL" ELAPSED=$((ELAPSED + INTERVAL))done
echo "Timed out waiting for delete after ${TIMEOUT_SECONDS}s" >&2exit 1Permissions
Section titled “Permissions”Only members with the admin role can delete clusters. A 403 Forbidden is returned for
readonly keys or members.