Taint , Tolerant

임종혁·2025년 4월 14일

Taint & Tolerant

특정 node 가 특정 pod 만 수용할 수 있도록 하거나 특정 node에 배치되지 않도록 하는 수단

Taint 는 node에 지정하는 요소

Tolerant는 pod에 지정하는 요소

Taint

key value 쌍의 값으로 이루어져 있음

  • NoSchedule: tolerant하지 않은 pod들은 node에 스케줄 되지 않도록 한다
  • PreferNoSchedule: tolerant하지 않은 pod들은 이 node에 스케줄 되는것을 피한다
  • NoExcute: 새롭게 생성되는 tolerant하지 않는 pod는 node에 스케줄되지 않고 이미 node에 배치된 pod 중 tolerant하지 않은 것들은 evict 처리한다
# node에 taint 설정
kubectl taint nodes node명 key=value:NoSchedule

# taint 삭제 
kubectl taint nodes node명 key=value:NoSchedule-

Control plane 에 pod 가 되지 않도록 하는 taint 처리는 존재

Tolerant

key , value , operator, effect를 사용하여 정의한다

apiVersion: v1

kind: Pod
metadata:
	name: my-pod
    
spec:
	tolerations:
    	- key: "app"
          value: "dev"
          operator: "Equal"
          effect: "NoSchedule"
    container:
    	- name: nginx
          image: nginx

0개의 댓글