Remove clusters that no longer exist from the local instance list
Synopsis
Remove clusters that no longer exist (expired after 12 hours, or destroyed elsewhere) from the local instance list, together with their stored kubeconfig.
An entry counts as gone only on a definite answer:
- the cluster service doesn't know the cluster id, or
- it does, but the cluster's Kubernetes API rejects the stored kubeconfig (a released VM keeps its IP but gets new credentials, so the address now serves another cluster). Entries that can't be checked (network error, any other answer) are kept, and a cluster that doesn't answer at all is kept too. An entry whose kubeconfig holds more than the cluster's one context (e.g. kubectl or kind added theirs after 'nova instance env') is never pruned: remove it explicitly with 'nova instance remove <name>'.
The entries found are listed with the reason, and the command asks before removing them; -y removes them without asking (required without a terminal, e.g. for agents and scripts).
nova k8srun prune [flags]
Examples
$ nova k8srun prune --dry-run
$ nova k8srun prune
$ nova k8srun prune -y
Options
--dry-run Only print the entries that would be removed
-h, --help help for prune
-o, --output format Output format: text or json (default text)
-y, --yes Remove the entries without asking
Options inherited from parent commands
--debug Write diagnostic output to stderr: HTTP requests and responses, external commands, the resolved instance. Known secrets are redacted, but bodies (app environments, kubeconfigs) can still contain some: don't share the output unreviewed (env: NOVA_DEBUG=1)
--env string (Wandelbots internal) Portal environment for this invocation: prod, stg or dev (default: the environment of the cloud instance, else of the last 'nova login'; env: NOVA_ENV)
--insecure-skip-tls-verify If true, the server's certificate will not be checked for validity (disables TLS verification for all requests)
--instance string Name of the instance to work against for this invocation (overrides the selected instance; env: NOVA_INSTANCE)
SEE ALSO
- nova k8srun - (Wandelbots internal) Create or destroy Kubernetes clusters with Wandelbots NOVA OS and a kubeconfig