관리 메뉴

피터의 개발이야기

[kubernetes] that the pod didn't tolerate. 트러블 슈팅, taint와 toleration 본문

Kubernetes/트러블슈팅&장애대응

[kubernetes] that the pod didn't tolerate. 트러블 슈팅, taint와 toleration

기록하는 백앤드개발자 2022. 10. 21. 10:10
반응형

ㅁ 개요

  taint와 tolerations는 주로 노드를 특정해서 스케줄하기 위해 사용한다. taint가 걸려 있는 노드에는 toleration을 주지 않으면  kube-system의 coreDns, metric-server 등 pending된다. 해결 방법은 toleration을 주는 것이다.

 

ㅁ CloudFormation으로 특정노드에 taint 주입

 ㅇ CloudFormation으로 WorkNode의 AutoScale그룹까지 생성된다. 

 ㅇ 이 때에 생성되는 노드에 taint를 주입하였다.

 

 

ㅁ 시스템 Pod들의 Pending 확인

68s Warning FailedScheduling pod/coredns-556f6dffc4-bfs7s 0/2 nodes are available: 2 node(s) had taint {dedicated: rsts}, that the pod didn't tolerate.
68s Warning FailedScheduling pod/coredns-556f6dffc4-d7zgd 0/2 nodes are available: 2 node(s) had taint {dedicated: rsts}, that the pod didn't tolerate.

    taint 조건에 따른 toleration이 주어지지 않은 Pod는 해당 노드에 스케줄링 할 수 없기 때문에 pending 되고 위와 같은 경고 이벤트를 남긴다. 

 

ㅁ toleration 적용

# deployment 수정
$ kubectl edit -n kube-system deployments.apps coredns

... 생략 ...
tolerations:
- effect: NoSchedule
  key: node-role.kubernetes.io/master
- key: CriticalAddonsOnly
  operator: Exists

 ㅇ 수정을 완료하면 coredns 새롭게 생성된다.

 

 

ㅁ pod 스케줄 확인

 ㅇ pending 되었던 addon coredns가 정상적으로 스케줄링 되었다.

 

 

ㅁ 함께 보면 좋은 사이트

 

테인트(Taints)와 톨러레이션(Tolerations)

노드 어피니티는 노드 셋을 (기본 설정 또는 어려운 요구 사항으로) 끌어들이는 파드의 속성이다. 테인트 는 그 반대로, 노드가 파드 셋을 제외시킬 수 있다. 톨러레이션 은 파드에 적용된다. 톨

kubernetes.io

 

 

 

반응형
Comments