Configure your local Kubernetes context¶
Keyword: How do I configure kubectl for SmartTouch remote access? Part of: Set up local development — Step 2 of 3
The Remote Access Service runs in a dedicated Kubernetes namespace. Configuring your local Kubernetes context gives you direct access to session broker pod logs, metrics, and events — essential for debugging connection issues and session failures.
Goal¶
Configure kubectl to reach the SmartTouch dev cluster and confirm you can view the Remote Access Service namespace.
Prerequisites¶
- Completed Install the SmartTouch CLI
stctl auth statusreturns your email
Steps¶
Step 1 — Install kubectl¶
macOS¶
brew install kubectl
Linux¶
curl -LO "https://dl.k8s.io/release/$(curl -sSL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl && sudo mv kubectl /usr/local/bin/
Verify:
kubectl version --client
Step 2 — Fetch the kubeconfig¶
stctl kubeconfig get --env dev
Expected output:
✔ Fetched credentials for env: dev
✔ Merged into ~/.kube/config
✔ Context added: smarttouch-dev
Step 3 — Set the active context¶
kubectl config use-context smarttouch-dev
Step 4 — Verify access to the Remote Access Service namespace¶
The Remote Access Service runs in smarttouch-remote-access. You have read-only access to this namespace.
kubectl get pods --namespace smarttouch-remote-access
Expected output lists the running broker pods:
NAME READY STATUS RESTARTS
remote-access-service-6c8d4f-ql7rn 1/1 Running 0
remote-access-service-6c8d4f-xm4pk 1/1 Running 0
If the namespace is empty, the Remote Access Service has not been deployed yet. Complete Deploy the Remote Access Service first.
Step 5 — View broker logs directly¶
During development, reading broker logs helps diagnose session failures:
kubectl logs --namespace smarttouch-remote-access \
--selector app=remote-access-service \
--follow
Press Ctrl+C to stop streaming.
Step 6 — Set a default namespace for your team¶
kubectl config set-context --current --namespace team-myteam
Remote Access namespace layout¶
| Namespace | Contains | Your access |
|---|---|---|
team-<name> |
Your deployed services | Full read/write |
smarttouch-remote-access |
Remote Access Service, session proxy | Read only |
smarttouch-audit |
Audit log collector | No direct access — use stctl remote-access audit |
Validation¶
kubectl config current-context
# Returns: smarttouch-dev
kubectl get pods --namespace smarttouch-remote-access
# Returns remote-access-service pods in Running state
Troubleshooting¶
Error from server (Forbidden) on smarttouch-remote-access
Your account is missing the developer role. Contact your Administrator to confirm your role assignment.
Namespace shows no pods Deploy the Remote Access Service first: Deploy the Remote Access Service.
Unable to connect to the server
Connect to your organisation's VPN if required, then retry.
Next steps¶
→ Continue to Step 3: Run the Remote Access Service locally