Use kubectl with your vCluster
From your own computer, use kubectl against a vCluster to read pods, follow logs, enter a container and restart a deployment.
Once you are connected, day-to-day work really only needs a handful of commands. This page assumes your kubeconfig is downloaded and kubectl is installed on your computer; if not, do Connect to your vCluster first. Everything below runs on your own computer, not in Studio's web terminal.
Before you start
| What you need | How to check |
|---|---|
| kubectl installed | kubectl version --client prints a Client Version |
| Your kubeconfig in hand | Downloaded from the cluster's Access → My access, and the file is on your computer |
| You know when your kubeconfig expires | The temporary one lasts 1–12 hours; once it expires kubectl answers Unauthorized |
| You know which application you are working on | Its name is on Deployments in Studio, or on the cluster's Apps tab |
Step 1: Confirm which cluster you are targeting, and point kubectl at it
- Go back to Studio's Machines page, open that vCluster and note its name.
- Save the yaml you downloaded from Access → My access as
~/.kube/vcluster.yaml. - In a terminal, run
export KUBECONFIG=~/.kube/vcluster.yaml, thenkubectl config current-context.
Check it worked: the name current-context prints matches the cluster in Studio. When you manage several at once, pointing KUBECONFIG at only one at a time is the least error-prone.

Step 2: See how the pods are doing
kubectl get pods: readREADY,STATUSandRESTARTS. ARESTARTScount that keeps climbing means trouble.kubectl get pods -o wide: adds a node column, so you can see which machine a pod landed on.kubectl get pods --watch: keeps the list updating; press Ctrl-C to stop it.
Check it worked: the pod you care about is Running and READY is 1/1. Any other STATUS means it has not come up yet (restarting over and over and an image that cannot be pulled both count); the plain-language reason and the suggested fix are on Studio's Status & events.
Step 3: Read the logs
kubectl logs <pod name>: prints that pod's output.- When a pod runs several containers, add
-c <container name>; if you are unsure of the name, look for the pod showing2/2inkubectl get pods. - For a pod that keeps restarting, add
-pto read the output from before the restart; the error is usually in there. - To follow it live:
kubectl logs -f <pod name>.
Check it worked: you see the messages the program itself prints. If -p returns nothing, the pod has not restarted yet, so read the version without -p.
Step 4: Go into the container and look for yourself
kubectl exec -it <pod name> -- /bin/bash; if the image has no bash, use/bin/sh.- Inside, check that the files are there and the environment variables are right; an application with a GPU can run
nvidia-smioramd-smito confirm it sees the card. - To test the application itself, run
curl localhost:<port>inside the container. exitreturns you to your own computer.
Check it worked: the prompt becomes the container's and the commands run there rather than on your computer. If you cannot get in, first confirm the pod is Running and that your role includes Shell access.
Step 5: Restart the deployment
kubectl get deployfinds the application's deployment name.kubectl rollout restart deployment/<name>replaces the old pods one at a time; the image does not change.kubectl rollout status deployment/<name>follows it until the swap finishes.
Check it worked: rollout status reports success at the end, and kubectl get pods shows the new pods Running with RESTARTS at 0. This is the same as selecting Restart at the top right of the application page in Studio.
A temporary kubeconfig lasts 12 hours at most. For longer work switch to the plugin version (where the page offers Download kubeconfig): the file carries no token and exchanges for a 15-minute credential on every connection, so you do not keep downloading it; where it is not offered, download a fresh one before yours expires.
Common snags
| What you see | Usual cause | What to do |
|---|---|---|
Every command answers Unauthorized | The kubeconfig expired, or the assignment was revoked | Download a fresh one under My access; if a new file is still refused, the access was taken away |
| Pods are visible, but exec and logs are refused | Your role does not include that permission | A Viewer, for example, cannot enter containers; ask whoever manages access to change your role |
connection refused, or it never connects | The network cannot reach the cluster, or the kubeconfig belongs to another one | Check current-context first; if a corporate network blocks it, use Open Webshell on the application page in Studio |
command not found: kubectl | kubectl is not installed, or not on the PATH | Reinstall it following step 3 of Connect to your vCluster |
| The pod name is different every time | A restart creates a new pod with a random name | Run kubectl get pods again each time; for a stable filter, use kubectl get pods --show-labels to find a label and add -l |
rollout status hangs | A new pod will not start and the old one is still carrying the load | Open a second terminal, run kubectl get pods to read the new pod's state, then go back to Studio's Status & events |
Next steps
- Connect to your vCluster: the first connection, downloading a kubeconfig, checking permissions
- Application troubleshooting: the commands only give you a status; the plain-language reason is in Studio
- Deploy an application: put another application on the same cluster
Connect to your vCluster
Find your vCluster, download your own kubeconfig, install kubectl and confirm you can see the nodes and the applications running on it.
Supply compute
Connect a host, convert it into a compute source, split it into vClusters, set hourly rates and publish, handle rental requests, and know how to reclaim a vCluster when you stop renting it out.