TL;DR: In this article, you will learn how packets flow inside and outside a Kubernetes cluster. Starting from the initial web request and down to the

Tracing the path of network traffic in Kubernetes

submited by
Style Pass
2022-01-14 07:00:10

TL;DR: In this article, you will learn how packets flow inside and outside a Kubernetes cluster. Starting from the initial web request and down to the container hosting the application.

Before diving into the details on how packets flow inside a Kubernetes cluster, let's first clear up the requirements for a Kubernetes network.

In this article, you will focus on the first three points, starting with intra-pod networking or container-to-container communication.

You can use Linux network namespaces to create isolated networks. Each network is independent and doesn't talk to the others unless you configure it to.

The network namespaces can be managed by the ip-netns management tool, and you can use ip netns list to list the namespaces on a host.

Please note that when a network namespace is created, it will be present under /var/run/netns but Docker doesn't always respect that.

The container is listed in the mount (mnt), Unix time-sharing (uts) and PID (pid) namespace, but not in the networking namespace (net).

Leave a Comment