ops can be used to get shell access to the underlying Kubernetes cluster of an environment.
- Login to your LocalOps account
- Use
opsCLI to set Kubernetes context ofkubectlCLI to point at the environment’s Kubernetes cluster. - Then use
kubectlto 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.env-id, visit your environment dashboard and see “Shell” tab.
Use Kubectl
Afterupdate-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:
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 withops update-kubeconfig, simply launch k9s:
ops update-kubeconfig. To launch k9s directly in the
app-services namespace where your services run:
- 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
Shell into a pod
To get a shell inside a running pod, first identify the pod name in theapp-services namespace:
Some containers may use
/bin/bash instead of /bin/sh. If /bin/sh fails, try /bin/bash.s to open a shell session directly.