> ## Content Index
> Fetch the complete content index at: https://www.popit.kr/llms.txt
> Use this file to discover other available public pages before exploring further.

# kubernetes wc[defunct] 프로세스 버그 관련
- URL: https://www.popit.kr/kubernetes-defunct-process-bug/
- Published: 2017-07-19T23:40:42.000Z
- Updated: 2017-07-20T00:17:04.000Z
- Author: 김형준
- Tags: #소프트웨어, kubernetes

현재 운영하는 서비스가 kubernetes 기반으로 운영되고 있는데 최근 예상하지 못한 장애 상황이 발생하여 조치한 내용을 공유해 드립니다.

## 장애 상황

- docker container가 운영되고 있는 서버에서 모든 명령(top 등) 수행시 다음과 같은 에러 메시지가 출력됨

> "resource temporarily unavailable"

- /var/log/syslogs 에도 동일한 메시지가 많이 나타남
- 각 docker container는 기능을 수행하지 못하지만 Host 서버가 Live한 상태라서 자동 Failover 등이 수행되지 않음

## 조치 내역

- 모든 명령이 수행되지 않아서 일단 서버(가상머신) 재시작
- /var/log/syslogs 메시지 확인
- wc defunct로 구글링 후 다음과 같은 kubernetes 버그 확인
  - [https://github.com/kubernetes/kubernetes/issues/39334](https://github.com/kubernetes/kubernetes/issues/39334?ref=popit.kr)
  - 1.5.6 버전에서 Fix
- 1.5.7로 업그레이드 결정
  - 업그레이드 결정만 하였고 아직 업그레이드는 미진행

현재 설치된 kube version 확인  

```
root@server01:~# kubectl version 

Client Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.4", GitCommit:"7243c69eb523aa4377bce883e7c0dd76b84709a1", GitTreeState:"clean", BuildDate:"2017-03-07T23:53:09Z", GoVersion:"go1.7.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.4", GitCommit:"7243c69eb523aa4377bce883e7c0dd76b84709a1", GitTreeState:"clean", BuildDate:"2017-03-07T23:34:32Z", GoVersion:"go1.7.4", Compiler:"gc", Platform:"linux/amd64"}

```

새로 시작된 서버가 아닌 다른 서버의 프로세스 상태 확인

![defunt_process](https://www.popit.kr/content/images/wp/2017/07/defunt_process-563x600.png)

실제로는 30,000 개 이상이 존재

업그레이드 전에는 process 갯수를 모니터링해서 일정 갯수 이상 넘어가면 가상머신을 재시작하는 형태로 운영을 하고 있습니다. 업그레이드 완료 후 Fix 여부에 대해서는 이 글에 결과 남겨 놓겠습니다.

- 2017/7/20 업데이트: 글 공개하고 조금 있으니 담당자가 지난 밤에 업그레이드 완료 했다고 합니다. 프로세스 확인해보니 정상이네요.