astroctl infra kubernetes unregister
Unregister a cluster from AstroPulse
Synopsis
Completely remove a registered cluster from AstroPulse.
The request is accepted immediately and AstroPulse completes the cleanup in the background; you do not have to wait:
Terminal
1. With --delete-apps: AstroPulse DELETES all AstroPulse-managed applications from
the cluster, pruning them through the still-connected agent. By default
applications are LEFT RUNNING and AstroPulse just stops managing them.
2. AstroPulse then deactivates the agent and removes the cluster record and its
connection to the AstroPulse deployment service.
Removing the agent from the target cluster:
Terminal
- Without --delete-apps: the agent is removed here (best-effort, if kubeconfig is
provided).
- With --delete-apps: the agent is LEFT in place so AstroPulse can prune your
applications through it; it deactivates automatically once that finishes,
and you can remove it afterward. Removing it earlier would strand the deletion.
What this does NOT do:
Terminal
- 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, AstroPulse just stops managing them
- Does NOT remove cluster add-ons, with or without --delete-apps: they stay
installed and running, and AstroPulse stops managing them
Cost history:
Terminal
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 prod-01 --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.
Terminal
astroctl infra kubernetes unregister [cluster-name] [flags]
Examples
Terminal
# Unregister and leave applications running on the cluster (default)
astroctl infra k8s unregister --cluster-name my-cluster
# Unregister AND delete all AstroPulse-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
# Skip all confirmations (for automation/scripts)
astroctl infra k8s unregister --cluster-name my-cluster --yes
Options
Terminal
-c, --cluster-name string Name of the cluster to unregister
--context string Kubeconfig context to use
--delete-apps Delete AstroPulse-managed applications from the cluster (default: keep them running)
-h, --help help for unregister
--kubeconfig string Path to kubeconfig file (defaults to ~/.kube/config)
-n, --namespace string Namespace of the agent (defaults to the registered namespace; required when none is recorded)
--skip-agent Skip removing the agent from the target cluster
-y, --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
- astroctl infra kubernetes unregister agent - Disconnect an agent from AstroPulse