Skip to main content

astroctl infra kubernetes unregister

Unregister a cluster from the platform

Synopsis

Completely remove a registered cluster from Astro Platform.

What this does, in order:

1. Tombstones the agent so the platform stops accepting its health reports
2. With --delete-apps: DELETES all platform-managed applications from the
cluster — done through the still-live agent tunnel, so it must happen
before the agent is removed. By default applications are LEFT RUNNING.
3. Removes the cluster record and its ArgoCD registration from the platform
4. Removes the agent from the target cluster (best-effort, if kubeconfig is
provided). This is last on purpose: step 2 needs the agent tunnel.

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

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