UnieAI Studio

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 needHow to check
kubectl installedkubectl version --client prints a Client Version
Your kubeconfig in handDownloaded from the cluster's Access → My access, and the file is on your computer
You know when your kubeconfig expiresThe temporary one lasts 1–12 hours; once it expires kubectl answers Unauthorized
You know which application you are working onIts 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

  1. Go back to Studio's Machines page, open that vCluster and note its name.
  2. Save the yaml you downloaded from Access → My access as ~/.kube/vcluster.yaml.
  3. In a terminal, run export KUBECONFIG=~/.kube/vcluster.yaml, then kubectl 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.

The Machines page before anything is connected: Connect a machine and Rent a machine at the top right, usage at 0 / 3 — a row appears in the list once you connect or rent one.
Demo · 2026-11-23 · The Machines page before anything is connected: Connect a machine and Rent a machine at the top right, usage at 0 / 3 — a row appears in the list once you connect or rent one. Open full size

Step 2: See how the pods are doing

  1. kubectl get pods: read READY, STATUS and RESTARTS. A RESTARTS count that keeps climbing means trouble.
  2. kubectl get pods -o wide: adds a node column, so you can see which machine a pod landed on.
  3. 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

  1. kubectl logs <pod name>: prints that pod's output.
  2. When a pod runs several containers, add -c <container name>; if you are unsure of the name, look for the pod showing 2/2 in kubectl get pods.
  3. For a pod that keeps restarting, add -p to read the output from before the restart; the error is usually in there.
  4. 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

  1. kubectl exec -it <pod name> -- /bin/bash; if the image has no bash, use /bin/sh.
  2. Inside, check that the files are there and the environment variables are right; an application with a GPU can run nvidia-smi or amd-smi to confirm it sees the card.
  3. To test the application itself, run curl localhost:<port> inside the container.
  4. exit returns 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

  1. kubectl get deploy finds the application's deployment name.
  2. kubectl rollout restart deployment/<name> replaces the old pods one at a time; the image does not change.
  3. 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 seeUsual causeWhat to do
Every command answers UnauthorizedThe kubeconfig expired, or the assignment was revokedDownload 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 refusedYour role does not include that permissionA Viewer, for example, cannot enter containers; ask whoever manages access to change your role
connection refused, or it never connectsThe network cannot reach the cluster, or the kubeconfig belongs to another oneCheck current-context first; if a corporate network blocks it, use Open Webshell on the application page in Studio
command not found: kubectlkubectl is not installed, or not on the PATHReinstall it following step 3 of Connect to your vCluster
The pod name is different every timeA restart creates a new pod with a random nameRun 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 hangsA new pod will not start and the old one is still carrying the loadOpen a second terminal, run kubectl get pods to read the new pod's state, then go back to Studio's Status & events

Next steps