Skip to content

cub cluster detach

cub cluster detach

Remove a cluster's ConfigHub wiring and leave it running

Synopsis

The inverse of "cub cluster attach". The cluster is left running and its controller — Argo CD, Sveltos or Flux — left installed; what goes is the wiring:

  • everything that came from the apps Space — the root and the children: Argo Applications, Sveltos ClusterProfiles, or Flux OCIRepositories and Kustomizations — is deleted WITHOUT cascading, so the workloads they deployed stay (Applications lose their finalizers, ClusterProfiles are set to LeavePolicies, Kustomizations are suspended first);
  • k8sbot, cub's own bot, is deleted with its resources;
  • the registry credentials Secret is deleted, and k8sbot's key Secret with it, unless they were in the cluster before attach ("cub cluster attach --existing-secrets"), which leaves them and the k8sbot namespace;
  • the local kubeconfig, env file and record are removed.

By default the ConfigHub side is left in place — the cluster Space with its OCI target and k8sbot's Channel, the apps Space holding the controller's Units, any deployment Spaces bound to the target, and the cluster's service account. That config outlives the attachment and can be re-attached to a cluster later, so detaching does not throw it away.

Pass --delete-config to also delete that config: detach removes every Space whose release target is the cluster's OCI target (the apps Space, the k8sbot variant Space, and any deployment variant Spaces), then the cluster Space itself, then the service account. This is destructive and includes your deployment variant Spaces — it deletes their config, not just the wiring.

The cluster's record (written beside its kubeconfig by attach) says which ConfigHub server and organization it is wired to, and detach acts there, whichever cub context is current. Without the kubeconfig — on a machine other than the one that attached the cluster — the in-cluster cleanup is skipped and reported, and the ConfigHub side is still handled. For a kind cluster that "cub cluster up" created, use "cub cluster down", which also deletes it.

cub cluster detach <name> [flags]

Options

      --delete-config   also delete the ConfigHub config: the cluster's spaces (target, channel, apps, k8sbot, and deployment variants bound to the target) and its service account. Destructive.
      --force           proceed even if no matching ConfigHub Space (or context for the cluster's record) is found
  -h, --help            help for detach

Options inherited from parent commands

      --context string   The context to use for this command
      --debug            Debug output

SEE ALSO

  • cub cluster - Manage clusters wired into ConfigHub via Argo CD, Sveltos or Flux