Skip to content

ksail cluster switch

Switch the active kubeconfig context to the named cluster.
This command accepts a cluster name and automatically resolves it to the
correct kubeconfig context by checking all supported distribution prefixes
(kind-, k3d-, admin@, vcluster-docker_).
If multiple distributions have contexts for the same cluster name, the
command returns an error listing the matching contexts.
The kubeconfig is resolved in the following priority order:
1. From KUBECONFIG environment variable
2. From ksail.yaml config file (if present)
3. Defaults to ~/.kube/config
When called without arguments, an interactive picker is shown
to select from available clusters.
Examples:
# Switch to a Vanilla (Kind) cluster named "dev"
ksail cluster switch dev
# Switch to a cluster named "staging"
ksail cluster switch staging
# Select a cluster interactively
ksail cluster switch
Usage:
ksail cluster switch [cluster-name] [flags]
Global Flags:
--benchmark Show per-activity benchmark output
--config string Path to config file (default: ksail.yaml found via directory traversal)