Kubernetes Shell Access
For Valohai executions running on Kubernetes, you can open debug shells using kubectl exec instead of SSH. This method uses your existing Kubernetes credentials and doesn't require SSH key setup.
When to use this:
Your Valohai environment runs on Kubernetes
You need quick shell access without SSH configuration
You're a platform engineer with cluster access
Differences from SSH debugging:
No SSH keys or firewall rules required
Uses Kubernetes RBAC for authentication
Direct
kubectlaccess to podsCannot attach IDE debuggers (use SSH methods for that)
Prerequisites
You need cluster-level access to use kubectl:
1. Kubernetes Cluster Access
Configure kubectl to reach your cluster's control plane. This typically means:
Client certificate authentication
Service account with access token
Kubeconfig file properly configured
Verify access:
2. Required RBAC Permissions
Your Kubernetes user needs permissions in the valohai-workers namespace:
What this enables:
get pods- List and view execution podscreate pods/exec- Open shell sessions
💡 Contact your Kubernetes administrator if you don't have these permissions.
Open Shell to Execution
1. Start a Valohai Execution
Launch any execution using your Kubernetes environment. No special flags needed - SSH is not required for this method.
2. Get Pod Name from Logs
Find the unique pod name in the execution logs:

The logs will show something like:
Copy the pod name - you'll use it in the next step.
3. Execute Shell Command
Example:
Command breakdown:
-it- Interactive terminal<POD-NAME>- Your execution's unique pod name-c workload- Container name (alwaysworkloadfor Valohai)--namespace valohai-workers- Namespace (alwaysvalohai-workers)bash- Shell to open (can useshifbashunavailable)
What You Can Do
Once connected, you have shell access inside the execution container:
Inspect execution state:
Debug code:
Monitor resources:
Limitations
What you cannot do with kubectl exec:
Access multiple pods simultaneously from one command
Open tunnels to services (use SSH tunneling for this)
Comparison to SSH:
Authentication
Kubernetes RBAC
SSH keys
Setup complexity
Low (if you have cluster access)
Medium (firewall + keys)
IDE debugger support
❌ No
✅ Yes
Port forwarding
❌ No
✅ Yes
Use case
Quick inspection
Interactive debugging
Common Issues
Permission denied?
Verify you have
get podsandcreate pods/execpermissionsCheck you're using the correct namespace:
valohai-workers
Pod not found?
Ensure execution is still running (not completed/failed)
Verify pod name copied correctly from logs
Check you're connected to the correct cluster
Container 'workload' not found?
This is rare - contact Valohai support if you see this
Container name should always be
workload
Execution exits too quickly?
Add
sleep 1hto your execution command to keep it alive:
Last updated
Was this helpful?
