Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpuinfo not work in k8s with different requests cpu and limits cpu #664

Open
tangby opened this issue Nov 5, 2024 · 0 comments
Open

cpuinfo not work in k8s with different requests cpu and limits cpu #664

tangby opened this issue Nov 5, 2024 · 0 comments

Comments

@tangby
Copy link

tangby commented Nov 5, 2024

The template below is mostly useful for bug reports and support questions.
Feel free to remove anything which doesn't apply to you and add more information where it makes sense.

Required information

  • Distribution:
    • Ubuntu 24.04 LTS
  • LXCFS version:5.0.4
  • The output of
    • Linux k8s-node1 6.8.0-48-generic Change uptime format #48-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 27 14:04:52 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
    • sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
      proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
      udev /dev devtmpfs rw,nosuid,relatime,size=197387516k,nr_inodes=49346879,mode=755,inode64 0 0
      devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
      tmpfs /run tmpfs rw,nosuid,nodev,noexec,relatime,size=39484760k,mode=755,inode64 0 0
      /dev/sda3 / ext4 rw,relatime,stripe=64 0 0
      securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
      tmpfs /dev/shm tmpfs rw,nosuid,nodev,inode64 0 0
      tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k,inode64 0 0
      cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime 0 0
      pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0
      bpf /sys/fs/bpf bpf rw,nosuid,nodev,noexec,relatime,mode=700 0 0
      systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=32,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=20487 0 0
      hugetlbfs /dev/hugepages hugetlbfs rw,nosuid,nodev,relatime,pagesize=2M 0 0
      mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0
      debugfs /sys/kernel/debug debugfs rw,nosuid,nodev,noexec,relatime 0 0
      tracefs /sys/kernel/tracing tracefs rw,nosuid,nodev,noexec,relatime 0 0
      fusectl /sys/fs/fuse/connections fusectl rw,nosuid,nodev,noexec,relatime 0 0
      configfs /sys/kernel/config configfs rw,nosuid,nodev,noexec,relatime 0 0
      /dev/sda4 /boot ext4 rw,relatime,stripe=64 0 0
      /dev/sda5 /var ext4 rw,relatime,stripe=64 0 0
      /dev/sda2 /tmp ext4 rw,relatime,stripe=64 0 0
      /dev/sdb1 /home ext4 rw,relatime,stripe=64 0 0
      binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0
      tmpfs /home/kubelet/pods/f2d8e8f6-31c9-4b59-8d2b-18e96fd0f31f/volumes/kubernetes.iosecret/etcd-certs tmpfs rw,relatime,size=377021772k,inode64,noswap 0 0
      tmpfs /home/kubelet/pods/7a0a2452-ffba-4fad-ad77-172c96b8eb9d/volumes/kubernetes.io
      secret/etcd-certs tmpfs rw,relatime,size=377021772k,inode64,noswap 0 0
      tmpfs /home/kubelet/pods/7a0a2452-ffba-4fad-ad77-172c96b8eb9d/volumes/kubernetes.ioprojected/kube-api-access-v59v9 tmpfs rw,relatime,size=377021772k,inode64,noswap 0 0
      tmpfs /home/kubelet/pods/07364d16-ebb2-468d-91d0-172f02d4ed52/volumes/kubernetes.io
      projected/kube-api-access-g5q46 tmpfs rw,relatime,size=262144k,inode64,noswap 0 0
      tmpfs /home/kubelet/pods/f2d8e8f6-31c9-4b59-8d2b-18e96fd0f31f/volumes/kubernetes.ioprojected/kube-api-access-t8wt6 tmpfs rw,relatime,size=377021772k,inode64,noswap 0 0
      tmpfs /home/kubelet/pods/85e445d4-ada9-4a97-87ad-475afc280983/volumes/kubernetes.io
      projected/kube-api-access-ns26p tmpfs rw,relatime,size=377021772k,inode64,noswap 0 0
      tmpfs /home/kubelet/pods/7ff5609f-e379-4e13-9184-1541d2197b59/volumes/kubernetes.ioprojected/kube-api-access-4s9bv tmpfs rw,relatime,size=262144k,inode64,noswap 0 0
      shm /run/containerd/io.containerd.grpc.v1.cri/sandboxes/0a7cec9f6c8fc14f1f0aafee02f78ee52feaa24a22108b31c4bdf1f56edaa9ad/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=65536k,inode64 0 0
      shm /run/containerd/io.containerd.grpc.v1.cri/sandboxes/8fdfce491f39aca8dd57b93bb46162c81981fb8f6a5574f6451cde4850d1d2b1/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=65536k,inode64 0 0
      shm /run/containerd/io.containerd.grpc.v1.cri/sandboxes/fa11952150de64783c234de2066f403e7155361bb75a497b62e8ba3943e27140/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=65536k,inode64 0 0
      overlay /run/containerd/io.containerd.runtime.v2.task/k8s.io/0a7cec9f6c8fc14f1f0aafee02f78ee52feaa24a22108b31c4bdf1f56edaa9ad/rootfs overlay rw,relatime,lowerdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/1/fs,upperdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/54/fs,workdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/54/work,uuid=on,nouserxattr 0 0
      overlay /run/containerd/io.containerd.runtime.v2.task/k8s.io/8fdfce491f39aca8dd57b93bb46162c81981fb8f6a5574f6451cde4850d1d2b1/rootfs overlay rw,relatime,lowerdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/1/fs,upperdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/55/fs,workdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/55/work,uuid=on,nouserxattr 0 0
      overlay /run/containerd/io.containerd.runtime.v2.task/k8s.io/fa11952150de64783c234de2066f403e7155361bb75a497b62e8ba3943e27140/rootfs overlay rw,relatime,lowerdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/1/fs,upperdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/56/fs,workdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/56/work,uuid=on,nouserxattr 0 0
      overlay /run/containerd/io.containerd.runtime.v2.task/k8s.io/98c78e21dad7b366d32e63cc0ccc643769a8301422456e628543caa81b71969e/rootfs overlay rw,relatime,lowerdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/4/fs:/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/3/fs,upperdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/58/fs,workdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/58/work,uuid=on,nouserxattr 0 0
      overlay /run/containerd/io.containerd.runtime.v2.task/k8s.io/6bccc208e3eeee651f6f1b0271e1dd79e213a4ac1fe011a30bd7f2e66b5c12ef/rootfs overlay rw,relatime,lowerdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/12/fs:/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/8/fs,upperdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/59/fs,workdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/59/work,uuid=on,nouserxattr 0 0
      shm /run/containerd/io.containerd.grpc.v1.cri/sandboxes/b0c5472727c201ec19d3e49bd0de15ed2ea3a468cca5a42f1bbdf97f142d407c/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=65536k,inode64 0 0
      nsfs /run/netns/cni-613d5f95-7957-0fb9-3dfb-22f6445eeea2 nsfs rw 0 0
      shm /run/containerd/io.containerd.grpc.v1.cri/sandboxes/534574b139b9ce35fa210a515d3c27a1e63b1756d0f161f6ff7437e232e3909c/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=65536k,inode64 0 0
      nsfs /run/netns/cni-2c1d66e6-070d-fc61-aaed-4d69d113097f nsfs rw 0 0
      overlay /run/containerd/io.containerd.runtime.v2.task/k8s.io/b0c5472727c201ec19d3e49bd0de15ed2ea3a468cca5a42f1bbdf97f142d407c/rootfs overlay rw,relatime,lowerdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/1/fs,upperdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/60/fs,workdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/60/work,uuid=on,nouserxattr 0 0
      overlay /run/containerd/io.containerd.runtime.v2.task/k8s.io/534574b139b9ce35fa210a515d3c27a1e63b1756d0f161f6ff7437e232e3909c/rootfs overlay rw,relatime,lowerdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/1/fs,upperdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/62/fs,workdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/62/work,uuid=on,nouserxattr 0 0
      overlay /run/containerd/io.containerd.runtime.v2.task/k8s.io/6d4f3f01cbb1ce1713cfa9dbfc569e3ecd0a288e32e78ac32b865000e522bf44/rootfs overlay rw,relatime,lowerdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/18/fs,upperdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/64/fs,workdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/64/work,uuid=on,nouserxattr 0 0
      overlay /run/containerd/io.containerd.runtime.v2.task/k8s.io/23b02aff80d5ad77cff6a42d863c2e4096811202fdef83634e093dfa77f767c8/rootfs overlay rw,relatime,lowerdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/18/fs,upperdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/63/fs,workdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/63/work,uuid=on,nouserxattr 0 0
      none /run/calico/cgroup cgroup2 rw,relatime 0 0
      overlay /run/containerd/io.containerd.runtime.v2.task/k8s.io/0ee8e7271ed6572aa71fee7b553727301d0f15694d404d44ee9c5dadadb72fb3/rootfs overlay rw,relatime,lowerdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/14/fs,upperdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/67/fs,workdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/67/work,uuid=on,nouserxattr 0 0
      lxcfs /var/lib/lxcfs fuse.lxcfs rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other 0 0
      tmpfs /home/kubelet/pods/1d66f6c7-a96a-4eea-80ca-781a70c96498/volumes/kubernetes.io
      projected/kube-api-access-td9nk tmpfs rw,relatime,size=2097152k,inode64,noswap 0 0
      shm /run/containerd/io.containerd.grpc.v1.cri/sandboxes/47b8d51d02766454949cea10831beab96ffd6ae83d83320eda02abe0af7a918b/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=65536k,inode64 0 0
      nsfs /run/netns/cni-6f78748d-e8aa-4b6c-2ff0-896567e32482 nsfs rw 0 0
      overlay /run/containerd/io.containerd.runtime.v2.task/k8s.io/47b8d51d02766454949cea10831beab96ffd6ae83d83320eda02abe0af7a918b/rootfs overlay rw,relatime,lowerdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/1/fs,upperdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/72/fs,workdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/72/work,uuid=on,nouserxattr 0 0
      lxcfs /home/kubelet/pods/1d66f6c7-a96a-4eea-80ca-781a70c96498/volume-subpaths/lxc-proc/nginx/0 fuse.lxcfs rw,relatime,user_id=0,group_id=0,allow_other 0 0
      lxcfs /home/kubelet/pods/1d66f6c7-a96a-4eea-80ca-781a70c96498/volume-subpaths/lxc-proc/nginx/1 fuse.lxcfs rw,relatime,user_id=0,group_id=0,allow_other 0 0
      lxcfs /home/kubelet/pods/1d66f6c7-a96a-4eea-80ca-781a70c96498/volume-subpaths/lxc-proc/nginx/2 fuse.lxcfs rw,relatime,user_id=0,group_id=0,allow_other 0 0
      lxcfs /home/kubelet/pods/1d66f6c7-a96a-4eea-80ca-781a70c96498/volume-subpaths/lxc-proc/nginx/3 fuse.lxcfs rw,relatime,user_id=0,group_id=0,allow_other 0 0
      lxcfs /home/kubelet/pods/1d66f6c7-a96a-4eea-80ca-781a70c96498/volume-subpaths/lxc-proc/nginx/4 fuse.lxcfs rw,relatime,user_id=0,group_id=0,allow_other 0 0
      lxcfs /home/kubelet/pods/1d66f6c7-a96a-4eea-80ca-781a70c96498/volume-subpaths/lxc-proc/nginx/5 fuse.lxcfs rw,relatime,user_id=0,group_id=0,allow_other 0 0
      lxcfs /home/kubelet/pods/1d66f6c7-a96a-4eea-80ca-781a70c96498/volume-subpaths/lxc-proc/nginx/6 fuse.lxcfs rw,relatime,user_id=0,group_id=0,allow_other 0 0
      overlay /run/containerd/io.containerd.runtime.v2.task/k8s.io/302b44433ede7b44c827bf28529a751ac290beb1b1eba9f8a80e656aac6760ab/rootfs overlay rw,relatime,lowerdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/18/fs,upperdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/73/fs,workdir=/home/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/73/work,uuid=on,nouserxattr 0 0
      tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=39484756k,nr_inodes=9871189,mode=700,uid=1000,gid=1000,inode64 0 0
    • root 18614 0.0 0.0 377472 1920 ? Ssl Nov04 0:00 /usr/bin/lxcfs /var/lib/lxcfs

Issue description

if a same requests cpu and limits cpu, the cpuinfo is exact, other is not.

Steps to reproduce

the pod yaml:
limits:
cpu: "4"
memory: 2Gi
requests:
cpu: "2"
memory: 1Gi

cpu info:
cat /proc/cpuinfo |grep processor|wc -l
44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant