Skip to main content
LocalOps CLI ops can be used to get shell access to the underlying Kubernetes cluster of an environment.
To get shell access, you need to
  1. Login to your LocalOps account
  2. Use ops CLI to set Kubernetes context of kubectl CLI to point at the environment’s Kubernetes cluster.
  3. Then use kubectl to inspect the cluster.

Login to LocalOps

Login to LocalOps account using your email address.

Set kubernetes context

Use this commnd updates your local current context to point at the environment’s kubernetes cluster.
To get env-id, visit your environment dashboard and see “Shell” tab.

Use Kubectl

After update-kubeconfig command succeeds, you can use any kubectl command to inspect pods, deployments, jobs and everything else running in your LocalOps environment. All your services are deployed in the app-services namespace. To see only your service pods:
To see all cluster resources across all namespaces:

Monitor pods with k9s

k9s is a terminal-based UI that makes it easy to monitor and manage Kubernetes resources. After setting up your kubeconfig with ops update-kubeconfig, simply launch k9s:
k9s will automatically use the current Kubernetes context set by ops update-kubeconfig. To launch k9s directly in the app-services namespace where your services run:
From the k9s interface you can:
  • View all pods and their status in real time
  • Watch logs by selecting a pod and pressing l
  • Filter resources by namespace using / to search
  • Delete, describe, or edit resources interactively
Install k9s via Homebrew with brew install derailed/k9s/k9s on macOS, or see the k9s installation guide for other platforms.

Shell into a pod

To get a shell inside a running pod, first identify the pod name in the app-services namespace:
Then exec into the pod:
Some containers may use /bin/bash instead of /bin/sh. If /bin/sh fails, try /bin/bash.
You can also use k9s to get a shell — select a pod and press s to open a shell session directly.