[英]Tcpdump from a pod for cluster in kubernetes setup (In Minikube setup)
I am new to kubernetes. 我是kubernetes的新手。 The whole setup I have configured in Minikube. 我已经在Minikube中配置了整个设置。 I am not sure it should different than any other kubernetes setup. 我不确定它是否应该与任何其他Kubernetes设置不同。
I have created a POD in my setup and an spring boot application is running inside on 8080 port and this service to expose to Cluster on 20080 port. 我在设置中创建了一个POD,并且Spring Boot应用程序在8080端口上运行,并且该服务在20080端口上公开给Cluster。
I am running another pod inside the cluster where tcpdump is running. 我正在运行tcpdump的集群中运行另一个Pod。 I have requirement to dump the HTTP packets hitting the cluster on 20080. Please let me know how I can access Cluster interface from the tcpdump pod. 我需要转储在20080时到达群集的HTTP数据包。请让我知道如何从tcpdump pod访问群集接口。
I tried google and tried using Cluster IP directly from the POD,but it didn't work. 我尝试了google,并尝试直接从POD中使用群集IP,但是它不起作用。
The POD that is running tcpdump can only see its own netns, except you run the POD with the hostNetwork: true
option. 除了使用hostNetwork: true
选项运行POD之外,运行tcpdump的POD只能看到其自己的netns。
So maybe what you can do is running POD with hostNetwork: true
option, then use tcpdump to monitor the host's physical interface to grab the network packages on port 20080. Also you can monitor the network interface of the POD that's running the spring boot, if you can find the POD's network interface, which depends on the network configurations. 因此,也许您可以执行的操作是使用hostNetwork: true
选项运行POD,然后使用tcpdump监视主机的物理接口以捕获端口20080上的网络软件包。此外,您还可以监视运行Spring Boot的POD的网络接口。您可以找到POD的网络接口,具体取决于网络配置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.