Bug 11574 - k8s 运行etcd时报错
Summary: k8s 运行etcd时报错
Status: RESOLVED INVALID
Alias: None
Product: ANCK 6.6 Dev
Classification: ANCK
Component: fs (show other bugs) fs
Version: 6.6.25-2.1
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: Ferry Meng
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-30 19:27 UTC by zhanghongchen
Modified: 2024-12-12 17:26 UTC (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zhanghongchen loongson_group 2024-10-30 19:27:47 UTC
Description of problem:
k8s运行etcd镜像时报错:
[root@anolis test]# ctr -n k8s.io run k8s.gcr.io/etcd:3.5.1-0 etcd ls
ctr: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error setting cgroup config for procHooks process: openat2 /sys/fs/cgroup/k8s.io/etcd/cpu.weight: no such file or directory: unknown


Version-Release number of selected component (if applicable):
[root@anolis test]# uname -a
Linux anolis 6.6.52+ #7 SMP PREEMPT_DYNAMIC Wed Oct 30 02:01:52 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
[root@anolis test]# ctr --version
ctr github.com/containerd/containerd 1.6.20


How reproducible: 100%

Steps to Reproduce:
1. 初始化配置
# containerd config default | tee /etc/containerd/config.toml
# sed -i "s#SystemdCgroup\ \=\ false#SystemdCgroup\ \=\ true#g" /etc/containerd/config.toml
# sed -i "s#registry.k8s.io#registry.aliyuncs.com/google_containers#g" /etc/containerd/config.toml
​
2. 配置crictl
# cat <<EOF | tee /etc/crictl.yaml
runtime-endpoint: unix:///run/containerd/containerd.sock
image-endpoint: unix:///run/containerd/containerd.sock
timeout: 10
debug: false
EOF

3. 开启containerd服务
systemctl start containerd
systemctl status containerd --查看服务是否正常开启
4. 在cr仓库上拉取镜像
  ctr -n=k8s.io images pull registry.cn-hangzhou.aliyuncs.com/google_containers/etcd:3.5.1-0


5. 运行etcd
  ctr -n k8s.io  run registry.cn-hangzhou.aliyuncs.com/google_containers/etcd:3.5.1-0 etcd ls

Actual results:
[root@anolis test]# ctr -n k8s.io run k8s.gcr.io/etcd:3.5.1-0 etcd ls
ctr: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error setting cgroup config for procHooks process: openat2 /sys/fs/cgroup/k8s.io/etcd/cpu.weight: no such file or directory: unknown

Expected results:

无报错

Additional info:
Comment 1 Ferry Meng alibaba_cloud_group 2024-12-12 17:26:11 UTC
According to err log "openat2 /sys/fs/cgroup/k8s.io/etcd/cpu.weight: no such file or directory: unknown" 

Please check if you have enabled "cgroup-V2"

update boot cmdline param like
 "systemd.unified_cgroup_hierarchy=1" 

By the way, this is not a 'fs' bug, I make it as "Invalid". If you still have problem, you can reopen it later.