The list command shows all vClusters that are accessible from your current Kubernetes context. It displays information about each vCluster including name, namespace, status, and connected status.
NAME NAMESPACE STATUS CONNECTED CREATED AGE CONTEXTmy-vcluster team-x Running True 2024-03-05 10:30:15 +0000 UTC 2d vcluster_my-vcluster_team-x_kind-kinddev-vcluster development Running False 2024-03-04 14:22:08 +0000 UTC 3d staging-cluster staging Paused False 2024-02-28 09:15:42 +0000 UTC 7d
Columns:
NAME - vCluster name
NAMESPACE - Kubernetes namespace
STATUS - Current status (Running, Paused, Pending, Failed)
CONNECTED - Whether this is your active kubectl context
#!/bin/bash# Get all running vClustersrunning_vclusters=$(vcluster list --output json | jq -r '.[] | select(.Status=="Running") | .Name')for vc in $running_vclusters; do echo "Processing $vc" # Do something with each running vClusterdone
# Check if you have access to the namespacekubectl get namespaces# Check if vClusters existkubectl get pods --all-namespaces | grep vcluster# Try specific namespacevcluster list -n your-namespace
Permission errors
Ensure you have permissions to list resources:
# Check your permissionskubectl auth can-i list pods --all-namespaceskubectl auth can-i get statefulsets --all-namespaces
Wrong driver showing vClusters
Specify the correct driver:
vcluster list --driver helm # For Helm-managedvcluster list --driver platform # For Platform-managed