Run a quick interactive shell in kubernetes for testing purposes

Today I wanted to check some stuff on a pod running in my local kubernetes cluster. I’m still getting used to Kubernetes, thus didn’t want something ugly like exposing that pod.

The easiest way of doing it for me has been to spin up a temporary pod using Ubuntu;

kubectl run myshell --rm -i --tty --image ubuntu -- /bin/bash

Now you can do whatever you want in the pod and when you log out of myshell, it’ll be removed immediately and we’re back to square one! <3