CKA

Taints & Tolerations

백셀건전지 2021. 9. 5. 17:12
  • Taints와 Tolerations 는 어떤 파드가 어떤 node에 놓이면 안되는지를 제한하는 것
  • taints 와 tolerations 가 없으면 scheduler는 pod를 node에 균등하게 배포함
  • node에 taint를 설정하고 pod에 toleration을 설정하지 않으면 모든 pod는 node의 taint때문에 해당 node에 배포 불가
  • taint는 node 대상, tolerations는 pod 대상으로 설정한다
kubectl taint nodes node1 key1=value1:NoSchedule
  • taint-effect 종류
    • NoSchedule: pod를 해당 node에 신규 배포하지 않음
    • PreferNoSchedule: pod를 웬만하면 node에 배포를 피하지만 아예 안하진 않음
    • NoExecute: 신규 배포 안하고 기존 node에 있던 pod중 toleration 없으면 evicted 상태로 변경
  • pod의 toleration 선언은 spec.tolerations 에 함
    • key: taint의 key
    • operator: taint가 equal이면 "Equal"
    • value: taint의 value
    • effect: taint의 taint-effect
  • pod에 toleration이 설정되어 있다고 해도 taint의 node에만 생성되는 것이 아님. 
  • master node에 pod가 배포되지 않는 이유는 처음에 setup될 때 모든 pod에 대한 taint가 설정되었기 때문.

'CKA' 카테고리의 다른 글

DaemonSets  (0) 2021.09.05
Node Selector & Affinities  (0) 2021.09.05
Labels & Selectors  (0) 2021.09.05
Manual Scheduling  (0) 2021.09.03
Declarative commands  (0) 2021.09.02