astroctl infra kubernetes delete
Delete a k8s cluster
Synopsis
Delete a k8s cluster.
This destroys the cluster itself and everything AstroPulse recorded about it, including its cost history, on every plan and regardless of your retention setting. Cost history cannot be recovered, and creating a cluster with the same name later does not restore it. Export it first if you need it:
Terminal
astroctl infra k8s cost allocation prod-01 --window 30d -o json > cost.json
With --record-only, AstroPulse removes only its record of a self-hosted cluster whose stored key is gone, and what it holds for it, without touching your cloud account. Use it once the cluster's servers and setup resources are already deleted; the answer lists what may still be in your cloud account.
Terminal
astroctl infra kubernetes delete [cluster-name] [flags]
Examples
Terminal
# Delete a k8s cluster
astroctl infra k8s delete my-cluster
# Delete a k8s cluster with automatic confirmation
astroctl infra k8s delete my-cluster --yes
# See which volumes a delete would leave in your cloud account, deleting nothing
astroctl infra k8s delete my-cluster --dry-run
# Remove only AstroPulse's record of a self-hosted cluster whose stored key is gone
astroctl infra k8s delete my-cluster --record-only
# Delete a k8s cluster by cluster name
astroctl infra k8s delete -c my-cluster
Options
Terminal
-c, --cluster-name string The cluster name to delete
-y, --confirm Confirm the cluster deletion (default true)
--dry-run Show what the delete would do, grouped by kind, and delete nothing
-h, --help help for delete
--record-only Remove only AstroPulse's record of a self-hosted cluster whose stored key is gone; nothing in your cloud account is deleted
--show-all In a dry run, also list the items the delete would remove, not only the ones that need your attention
--yes Skip all confirmations (useful for automation)
Options inherited from parent commands
Terminal
-o, --output string Output format (table|json|yaml) (default "table")
SEE ALSO
- astroctl infra kubernetes - Manage Kubernetes clusters