본문 바로가기

Cloud/Kubernetes

memory.memsw.limit_in_bytes: no such file or directory 해결법

containerd를 이용해서 k8s를 구성할때 flannel pod를 생성하면 아래와 같은 오류가 발생한다.

Error: failed to create containerd task: 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: 
open /sys/fs/cgroup/memory/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-podc7c900fa_07d5_43cf_8ca5_b2b642a1705f.slice/cri-containerd-kube-flannel.scope/memory.memsw.limit_in_bytes: no such file or directory: unknown

 

정확한 원인은 아직 모르지만 현재 containerd.io Version: 1.6.13에서 발생한다.

$ containerd --version
containerd containerd.io 1.6.13 78f51771157abb6c9ed224c22013cdf09962315d

 

 

해결방법은 1.6.13버전 말고 아래 버전인 1.6.12-1로 재설치하면 해결된다.

$ sudo apt remove containerd.io -y
$ sudo apt install containerd.io=1.6.12-1 -y
$ kubectl get pods --all-namespaces
NAMESPACE      NAME                              READY   STATUS             RESTARTS        AGE
kube-flannel   kube-flannel-ds-pzdw6             1/1     Running            0               6s
kube-flannel   kube-flannel-ds-s844k             1/1     Running            0               6s
kube-flannel   kube-flannel-ds-wqzjq             1/1     Running            0               6s