Member-only story

K8s Tools — k8spacket

Use k8spacket and Grafana to visualize K8s cluster Traffic

Tony
3 min readJul 14, 2023
Pic from k8spacket

What is k8spacket?

k8spacket is a tool which allows you to visualize the TCP traffic in your K8s cluster, and let you understand better how different workloads communicate with each other. Use k8spackt and Grafana , you can easily check how many connections that were open, how many bytes were exchanged, and how long those connections were active.

A quick example looks like the following:

Pic from k8spacket

k8spacket is written in Golang that uses third-party libraries (gopacket) to sniff TCP packets (incoming and outgoing) on workloads, and it creates TCP listeners on running container network interfaces.

When a new container is created, the CNI plugin is responsible for providing the possibility to communicate with other containers or from the cluster to the outside world.

The most common approach is to use Linux namespaces to isolate networks, and veth pairs to connect isolated namespaces and bridges. However other types can also be created, such as vlan, ipvlan and macvlan . No matter with type, a network interface for…

--

--

Tony
Tony

Responses (5)