If you need to do some network debuggin in Kubernetes, e.g. to verify DNS resolution, Firewall issues or something along these lines, you can spin up a pod with networking tools installed and have the pod removed when you leave the interactive shell (via the --rm
argument).
This can be achieved with the following commands:
kubectl run -it --rm dnsutil -n <namespace> --image=dnsutils -- /bin/bash
or
kubectl run -it --rm aks-ssh --namespace <namespace> --image=nicolaka/netshoot
This last one spins up a container with plenty of networking tools installed, you can find the list here.
I hope you find this useful!