ammerzon
ammerzon

Reputation: 1078

How to get the traffic between pods in Kubernetes

There are already tools out there which visualize the traffic between pods. In detail the state the following:

Linkerd tap

I am now wondering how these tools get the data because the Kubernetes API itself does not provide this information. I know that Linkered installs a proxy next to each service but is this the only option?

Upvotes: 3

Views: 4221

Answers (3)

weibeld
weibeld

Reputation: 15292

The component that monitors the traffic must be either a sidecar container in each pod or a daemon on each node. For example:

  • Linkerd uses a sidecar container
  • Weave Scope uses a DaemonSet to install an agent on each node of the cluster

A sidecar container observes traffic to/from its pod. A node daemon observes traffic to/from all the pods on the node.

In Kubernetes, each pod has its own unique IP address, so these components basically check the source and destination IP addresses of the network traffic.

In general, any traffic from/to/between pods has nothing to do with the Kubernetes API and to monitor it, basically the same principles as in non-Kubernetes environments apply.

Upvotes: 3

wolmi
wolmi

Reputation: 1719

My advice is to use istio.io that injects an envoy proxy as a sidecar container on each pod, then you can use Prometheus to scrape metrics from these proxies and use Grafana for visualisation.

Upvotes: 0

Madhu Potana
Madhu Potana

Reputation: 91

You can use SideCar Proxy for it or use prometheus-operator which internally uses grafana dashboards. in there you can monitor each and everything.

Upvotes: 0

Related Questions