How to Jump onto a Kubernetes Pod with Bash
If you want to jump onto a particular Kubernetes Pod and run Bash within it, you can do so as follows:
kubectl exec -ti <pod_name> /bin/bash
You can get the <pod_name> by running kubectl get pods
This is the go-to command for debugging issues inside a running container — checking log files, testing network connectivity, or inspecting the filesystem. If the container doesn’t have bash installed (common with minimal Alpine-based images), try /bin/sh instead. You can also add -n <namespace> if the pod isn’t in the default namespace. For newer versions of kubectl, the syntax has changed slightly to kubectl exec -ti <pod_name> -- /bin/bash with the double dash separator.