Skip to main content

Kubernetes Network Debugging

·1 min·
Kubernetes Network Gist
Massimiliano Donini
Author
Massimiliano Donini
🚀 Freelance Cloud Architect | Based in The Netherlands 🇳🇱 | Ready to collaborate on cutting-edge Azure & .NET projects! 💡 Let’s talk Azure, .NET, EF Core, ASP.NET Core, Terraform, GitHub, and CI/CD automation. Got a question or an exciting project? Let’s connect! 🔥

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!