Taints / Tolerations
Taints는 노드가 파드 set을 제외하는 기능
노드에 Taints 추가하기
kubectl tain nodes node1 key1=value1:NoSchedule
node1 노드에 테인트를 배치한다. 테인트에는 키 key1, 값 value1 및 이펙트(effect) NoSchedule 이 있다. NoScheudle은 일치한는 톨러레이션이 없으면 파드를 node1 에 스케줄할 수 없다는 의미이다.
노드에 추가한 Taints 제거하기
kubectl taint nodes node1 key1=value1:Noschedule-
PodSpec에서 파드에 대한 톨러레이션을 지정한다. spec.tolerations
spec:
tolerations:
- key: "key1"
operator: "Equal"
value: "value1"
effect: "NoSchedule"
or
spec:
tolerations:
- key: "key1"
operator: "Exists"
effect: "NoSchedule"
operator의 기본값은 Equal 이다.
- Exists 인 경우 value를 지정하지 않아야 한다. key가 테인트와 일치한 경우 할당
- Equal 인 경우 value가 값이 같아야 한다.
테인츠/ 톨러레이션은 여러개 값을 가질 수 있다. 이를 effect를 통해 관리할 수 있다.
NoSchedule인 경우 노드에서 이미 파드가 실행 중인 경우 노드에 새로운 테인츠가 생겼다 하여도 파드는 축출되지 않는다. NoExecute를 가지는 경우 파드는 즉시 추출된다. tolerationSeconds 필드를 지정해서 바인딩된 최소시간을 지정하여 그 뒤에 추출
spec:
tolerations:
- key: "key1"
operator: "Equal"
value: "value1"
effect: "NoExecute"
tolerationSeconds: 3600
반응형