简体   繁体   中英

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 listens to a traffic stream for a resource.

  • In Weave Scope , edges indicate TCP connections between nodes.

链接器点击

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?

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.

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

我的建议是使用istio.io ,它在每个Pod上注入一个特使代理作为边车容器,然后可以使用Prometheus从这些代理中刮取指标,并使用Grafana进行可视化。

Conduit's telemetry system was moved to a completely pull-based (rather than push-based) model for metrics collection. As part of this, Conduit's Rust proxy was modified to expose granular metrics describing the source, destination, and health of all requests. A pull-based approach reduces complexity in the proxy, and fits better into the model of the world that Prometheus expects. I recommend you to watch this video and also read document , where everything is described.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM