vpsfreecz / vpsadminos

Host for Linux system containers based on NixOS, ZFS and LXC
https://vpsadminos.org
MIT License
155 stars 26 forks source link

iotop issue #50

Closed AkshayPai99 closed 2 years ago

AkshayPai99 commented 2 years ago

Hi there, while using iotop in kubernetes pods I am getting an error as below. Traceback (most recent call last): File "/usr/sbin/iotop", line 17, in main() File "/usr/lib/python3/dist-packages/iotop/ui.py", line 737, in main main_loop() File "/usr/lib/python3/dist-packages/iotop/ui.py", line 727, in main_loop = lambda: run_iotop(options) File "/usr/lib/python3/dist-packages/iotop/ui.py", line 620, in run_iotop return curses.wrapper(run_iotop_window, options) File "/usr/lib/python3.7/curses/init.py", line 94, in wrapper return func(stdscr, *args, **kwds) File "/usr/lib/python3/dist-packages/iotop/ui.py", line 609, in run_iotop_window taskstats_connection = TaskStatsNetlink(options) File "/usr/lib/python3/dist-packages/iotop/data.py", line 151, in init self.family_id = controller.get_family_id('TASKSTATS') File "/usr/lib/python3/dist-packages/iotop/genetlink.py", line 76, in get_family_id m = GeNlMessage.recv(self.conn) File "/usr/lib/python3/dist-packages/iotop/genetlink.py", line 56, in recv msg = conn.recv() File "/usr/lib/python3/dist-packages/iotop/netlink.py", line 255, in recv raise err OSError: Netlink error: No such file or directory (2)

I already found out a solution for this. That is using below two configurations in k8s manifests privileged : true hostNetwork: true But in our requirements it mandates to not use hostNetwork: true. So I just wanted to know why iotop demands hostNetwork : true ? And if you know any other way to run iotop without errors without using hostNetwork : true please let me know.

Thank You

snajpa commented 2 years ago

iotop works with vpsAdminOS and K8s under vpsAdminOS containers. Are you sure you're using vpsAdminOS?

AkshayPai99 commented 2 years ago

No I don't think so but is vpsAdminOS mandatory ?

aither64 commented 2 years ago

This issue tracker is for vpsAdminOS-related questions and problems.

Well, without hostNetwork: true, it will create a network namespace for that container, and maybe also a user namespace, not sure. At least within a user namespace, the netlink file which iotop needs is not available. This is how Linux kernel behaves. We have a patch that makes this file available and thus iotop works.