• 카테고리

    질문 & 답변
  • 세부 분야

    데브옵스 · 인프라

  • 해결 여부

    미해결

kubernetes 임계치값 질문있습니다~

22.04.11 12:39 작성 조회수 333

0

[질문 전 답변]
1. 강의 내용과 관련된 질문인가요? [예 | 아니요]
2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? [예 | 아니요]
3. 질문 잘하기 법을 읽어보셨나요? [예 | 아니요]
(https://www.inflearn.com/blogs/1719)
4. 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.

[질문 하기]
kubernetes 임계치값 기본값이 아래와 같이 설정되어있을때
memory.available<100Mi
nodefs.available<10%
nodefs.inodesFree<5%
imagefs.available<15%     <- 이미지 
 
1. 만약 /var/lib/docker/overlay2의 용량이 85%이상이되면 용량 확보를 위해 docker image를 랜덤으로 삭제하나요?

답변 1

답변을 작성해보세요.

1

안녕하세요 

우선 가능한 강의에서 다룬 주제 범위내에서 질문을 주시면 좋으실꺼 같습니다. 

아시는 것처럼 쿠버네티스를 주제로 한 모든 것에 대해서 질문 답변을 한다면, 저를 비롯한 도와주시는 2분으로는 부족하기 때문입니다. 

 

그럼에도 불구하고 꼭 모두가 알아야 하는 그러한 내용이라거나, 너무 궁금한데 찾아보고 연구해 봤는데 모르는 질문은 괜찮을 것 같습니다. 일단 처음이고 하니 예외적으로 아래와 같이 답변드립니다. 

 

강의를 거의 다 들으셨다면 kubelet의 역할에 대해서는 이해하실꺼고...각 노드(마스터 포함)에 kubelet이 CRI를 통해서 Pod를 생성하는 것도 이해하셨을 것 같습니다. 

위의 Parameter는 kubelet에서 각 노드에 사용되는 disk usage full을 방지하기 위한 것으로 

Pod가 과도하게 Disk를 사용하는 경우 Node 자원을 모두 고갈 시킬 위험이 있기 때문에 설정되어 있는 것입니다. 이때 Pod를 축출(Eviction) 하는 순서는 다음과 같습니다. 

Pod selection for kubelet eviction

If the kubelet's attempts to reclaim node-level resources don't bring the eviction signal below the threshold, the kubelet begins to evict end-user pods.

The kubelet uses the following parameters to determine pod eviction order:

  1. Whether the pod's resource usage exceeds requests
  2. Pod Priority
  3. The pod's resource usage relative to requests

As a result, kubelet ranks and evicts pods in the following order:

  1. BestEffort or Burstable pods where the usage exceeds requests. These pods are evicted based on their Priority and then by how much their usage level exceeds the request.
  2. Guaranteed pods and Burstable pods where the usage is less than requests are evicted last, based on their Priority.

따라서 질문 내용처럼 Docker image를 삭제하는 것이 아니라, 과도하게 자원을 요구하는 Pod를 축출해서 다른 노드로 보냅니다. 

다음의 내용들 함께 참고하시면 좋으실 것 같습니다. 

https://medium.com/kubernetes-tutorials/efficient-node-out-of-resource-management-in-kubernetes-67f158da6e59

https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/

https://uiandwe.tistory.com/1313