Closed kanghuzai closed 1 year ago
@kanghuzai have you passed --enable-loadavg
option to the lxcfs?
--enable-loadavg
ExecStart=/usr/bin/lxcfs --enable-loadavg /var/lib/lxcfs
systemd[1]: Stopping FUSE filesystem for LXC...
Jan 17 09:42:50 k8s-node-01 lxcfs[37160]: Running destructor lxcfs_exit
Jan 17 09:42:50 k8s-node-01 systemd[1]: lxcfs.service: main process exited, code=exited, status=1/FAILURE
Jan 17 09:42:50 k8s-node-01 fusermount[45128]: /bin/fusermount: failed to unmount /var/lib/lxcfs: Invalid argument
Jan 17 09:42:50 k8s-node-01 systemd[1]: Stopped FUSE filesystem for LXC.
Jan 17 09:42:50 k8s-node-01 systemd[1]: Unit lxcfs.service entered failed state.
Jan 17 09:42:50 k8s-node-01 systemd[1]: lxcfs.service failed.
Jan 17 09:42:50 k8s-node-01 systemd[1]: Started FUSE filesystem for LXC.
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: Running constructor lxcfs_init to reload liblxcfs
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: mount namespace: 4
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: hierarchies:
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: 0: fd: 5: name=systemd
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: 1: fd: 6: freezer
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: 2: fd: 7: devices
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: 3: fd: 8: net_cls,net_prio
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: 4: fd: 9: memory
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: 5: fd: 10: pids
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: 6: fd: 11: cpu,cpuacct
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: 7: fd: 12: blkio
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: 8: fd: 13: cpuset
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: 9: fd: 14: perf_event
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: 10: fd: 15: hugetlb
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: Kernel supports swap accounting
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: api_extensions:
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: - cgroups
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: - sys_cpu_online
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: - proc_cpuinfo
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: - proc_diskstats
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: - proc_loadavg
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: - proc_meminfo
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: - proc_stat
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: - proc_swaps
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: - proc_uptime
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: - proc_slabinfo
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: - shared_pidns
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: - cpuview_daemon
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: - loadavg_daemon
Jan 17 09:42:50 k8s-node-01 lxcfs[45130]: - pidfds
Jan 17 09:55:28 k8s-node-01 systemd[1]: Started FUSE filesystem for LXC.
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: Running constructor lxcfs_init to reload liblxcfs
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: mount namespace: 4
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: hierarchies:
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: 0: fd: 5: name=systemd
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: 1: fd: 6: freezer
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: 2: fd: 7: devices
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: 3: fd: 8: net_cls,net_prio
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: 4: fd: 9: memory
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: 5: fd: 10: pids
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: 6: fd: 11: cpu,cpuacct
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: 7: fd: 12: blkio
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: 8: fd: 13: cpuset
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: 9: fd: 14: perf_event
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: 10: fd: 15: hugetlb
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: Kernel supports swap accounting
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: api_extensions:
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: - cgroups
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: - sys_cpu_online
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: - proc_cpuinfo
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: - proc_diskstats
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: - proc_loadavg
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: - proc_meminfo
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: - proc_stat
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: - proc_swaps
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: - proc_uptime
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: - proc_slabinfo
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: - shared_pidns
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: - cpuview_daemon
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: - loadavg_daemon
Jan 17 09:55:28 k8s-node-01 lxcfs[44795]: - pidfds
@kanghuzai have you passed
--enable-loadavg
option to the lxcfs?
The function of the latest version 5.0.3 of this parameter, it still doesn't work after I have tested it.
# lxcfs -h
Usage: lxcfs <directory>
lxcfs is a FUSE-based proc, sys and cgroup virtualizing filesystem
Options :
-d, --debug Run lxcfs with debugging enabled
-f, --foreground Run lxcfs in the foreground
-n, --help Print help
-l, --enable-loadavg Enable loadavg virtualization
-o Options to pass directly through fuse
-p, --pidfile=FILE Path to use for storing lxcfs pid
Default pidfile is /run/lxcfs.pid
-u, --disable-swap Disable swap virtualization
-v, --version Print lxcfs version
--enable-cfs Enable CPU virtualization via CPU shares
--enable-pidfd Use pidfd for process tracking
Jan 17 09:42:50 k8s-node-01 fusermount[45128]: /bin/fusermount: failed to unmount /var/lib/lxcfs: Invalid argument
this error happened during unmounting. I don't understand, did you managed to run lxcfs with loadavg enabled successfully or not?
Jan 17 09:42:50 k8s-node-01 fusermount[45128]: /bin/fusermount: failed to unmount /var/lib/lxcfs: Invalid argument
this error happened during unmounting. I don't understand, did you managed to run lxcfs with loadavg enabled successfully or not?
Jan 17 09:42:50 k8s-node-01 fusermount[45128]: /bin/fusermount: failed to unmount /var/lib/lxcfs: Invalid argument
this error happened during unmounting. I don't understand, did you managed to run lxcfs with loadavg enabled successfully or not?
5.0.2 failed to run, 5.0.3 succeeded, but 5.0.3 did not take effect
An error that you've showed above can't be related to 5.0.2 or 5.0.3. It's just about existing mount on /var/lib/lxcfs
.
Have you passed --enable-loadavg
parameter? If yes, you can add debug prints to this line https://github.com/lxc/lxcfs/blob/cd2e3ac5c5ae4fde5b58380ac2f56e55c78e41cc/src/proc_loadavg.c#L188 to check if we just read host loadavg or not.
An error that you've showed above can't be related to 5.0.2 or 5.0.3. It's just about existing mount on
/var/lib/lxcfs
. Have you passed--enable-loadavg
parameter? If yes, you can add debug prints to this linehttps://github.com/lxc/lxcfs/blob/cd2e3ac5c5ae4fde5b58380ac2f56e55c78e41cc/src/proc_loadavg.c#L188
to check if we just read host loadavg or not.
It takes effect when I change to read-only attribute
After the installation is successful, manually add the '-- enable loadavg' parameter and set the '/proc/loadavg' file to read-only
systemctl stop lxcfs.service
sed -i 's\/usr/bin/lxcfs\/usr/bin/lxcfs --enable-loadavg\g' /usr/lib/systemd/system/lxcfs.service
systemctl daemon-reload
systemctl start lxcfs.service && systemctl status lxcfs.service
System info
Kubelet config
node enable cpuManager and nuam
Pod config
Pod exec result
Node exec result
The docker example is also not the expected result