Run a bash shell in Kubernetes Cluster

This is really simple. Use the kubectl run command to run a container quickly:

kubectl run my-shell --rm -i --tty --image ubuntu -n somenamespace -- bash

In my case I wanted to install some tools (which since it’s an ubuntu image you can!)

apt install dnsutils
apt install postgresql

Or if you just need curl (and some other network diagnostic tools):

kubectl run curl --image=radial/busyboxplus:curl -i --tty

Leave a Reply

Your email address will not be published. Required fields are marked *