wilson's story

[kubernetes] "command failed" err="failed complete: too many open files" 본문

Docker

[kubernetes] "command failed" err="failed complete: too many open files"

wilson 2024. 7. 9. 15:39
반응형

kubernetes에서 정상적으로 구동은 되고 있다고 보여지지만 막상 웹화면을 띄울때 안열리는 경우가 있었다 

찾아보니

 

kubectl get pods -n kube-system -l k8s-app=kube-proxy

NAME               READY   STATUS             RESTARTS       AGE
kube-proxy-d54xg   0/1     CrashLoopBackOff   26 (41s ago)   109m

 

proxy 부분에서STATUS가  CrashLoopBackOff 난 상황 -> kube-proxy가 구동되지 않는 현상이다

 

# 로그로 확인
kubectl logs kube-proxy-d54xg -n kube-system
E0709 04:11:40.558488       1 run.go:74] "command failed" err="failed complete: too many open files"

 

찾아보니 

리소스 제한으로 인하여 열려져 있는 파일이 많아서 pod 오류 (inotify - 파일 시스템 이벤트 모니터링) - 리소스가 부족해서 일어나는 현상이다

 

# 해결책 
echo fs.inotify.max_user_watches=655360 | sudo tee -a /etc/sysctl.conf
echo fs.inotify.max_user_instances=1280 | sudo tee -a /etc/sysctl.conf
sudo sysctl -p

 

늘려주면 해결이 된다

 

https://kind.sigs.k8s.io/docs/user/known-issues/#pod-errors-due-to-too-many-open-files

 

kind – Known Issues

Known Issues Having problems with kind? This guide covers some known problems and solutions / workarounds. It may additionally be helpful to: Troubleshooting Kind 🔗︎ If the cluster fails to create, try again with the --retain option (preserving the fa

kind.sigs.k8s.io

 

 

 

반응형