How can I install / use tcpdump on minikube?

…衆ロ難τιáo~ 提交于 2021-02-10 06:42:18

问题


I'm trying to investigate a network issue and would like to install tcpdump / tshark.

What package manager does minikube use? How can I install tcpdump?


回答1:


It is not an easy task.

Minikube VM is based on Buildroot distribution.

Usually minikube uses docker to build a buildroot image, but you can clone buildroot repo and configure it to include tcpdump package using specific targets (make iso-minikube, make iso-menuconfig).

Then you need to build a minikube image and run minikube using that image.
The manual is not full, but gives you the main idea of what to do.

Alternatively you may try to copy tcpdump and all its dependencies to minikube VM using scp.




回答2:


Probably the fastest way is using static tcpdump binary.

You can run this on minikube

curl https://raw.githubusercontent.com/yunchih/static-binaries/master/tcpdump -o tcpdump
chmod +x ./tcpdump

And now you can use it as a regular tcpdump

sudo ./tcpdump ...

PS. I don't recommend using random binaries from internet due to security reasons.

Preferably, compile it yourself from source as a static binary and then use it.



来源:https://stackoverflow.com/questions/54747069/how-can-i-install-use-tcpdump-on-minikube

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!