astroctl infra kubernetes unregister
Unregister a cluster from the platform
Synopsis
Completely remove a registered cluster from Astro Platform.
The request is accepted immediately and the platform completes the cleanup in the background — you do not have to wait:
1. With --delete-apps: the platform DELETES all platform-managed applications from
the cluster, pruning them through the still-connected agent tunnel. By default
applications are LEFT RUNNING and the platform just stops managing them.
2. The platform then deactivates the agent and removes the cluster record and its
PulseDeploy (CD) registration.
Removing the agent from the target cluster:
- Without --delete-apps: the agent is removed here (best-effort, if kubeconfig is
provided).
- With --delete-apps: the agent is LEFT in place so the platform can prune your
applications through its tunnel; it deactivates automatically once that finishes,
and you can remove it afterward. Removing it earlier would strand the deletion.
What this does NOT do:
- Does NOT delete or modify the cluster itself (EKS, GKE, etc.)
- Does NOT delete applications unless --delete-apps is passed; by default
they keep running, the platform just stops managing them
Cost history:
Removing the cluster record also removes this cluster's cost history, on every
plan and regardless of your retention setting. It cannot be recovered, and
re-registering the same name does not restore it. Export it first if you need
it:
astroctl infra k8s cost allocation <name> --window 30d -o json > cost.json
Only works for clusters registered via 'astroctl infra k8s register'. For provisioned clusters, use 'astroctl infra k8s delete' instead.
astroctl infra kubernetes unregister [flags]
Examples
# Unregister and leave applications running on the cluster (default)
astroctl infra k8s unregister --cluster-name my-cluster
# Unregister AND delete all platform-managed applications from the cluster
astroctl infra k8s unregister --cluster-name my-cluster --delete-apps
# Unregister with explicit kubeconfig context
astroctl infra k8s unregister --cluster-name my-cluster --context my-context
# Unregister without removing the agent binary from the cluster
astroctl infra k8s unregister --cluster-name my-cluster --skip-agent
Options
-c, --cluster-name string Name of the cluster to unregister
--context string Kubeconfig context to use
--delete-apps Delete platform-managed applications from the cluster (default: keep them running)
-h, --help help for unregister
--kubeconfig string Path to kubeconfig file (defaults to ~/.kube/config)
--skip-agent Skip removing the agent from the target cluster
Options inherited from parent commands
-o, --output string Output format (json|yaml) (default "yaml")
SEE ALSO
- astroctl infra kubernetes - Manage Kubernetes clusters
- astroctl infra kubernetes unregister agent - Disconnect an agent from the platform