심플코더
간단한 코딩 공간
   

글쓰기    관리    수식입력
  • 분류 전체보기 (84)
    • AWS (1)
    • JavaScript (11)
    • 개인학습 (5)
    • DB (11)
    • OS (9)
    • Network (7)
    • DevOps (0)
    • TypeScript (1)
    • 개발 (1)
    • CKA (28)
hELLO · Designed By 정상우.
심플코더

간단한 코딩 공간

CKA

(TIL) Kubernetes Taints & Toleration 와 Node Affinity

Intro

앞서 Kubernetes에서 파드의 스케줄링 노드 제한조건으로 사용할 수 있는 Taints & Toleration과 Node Affinity의 개념에 대해서 알아보았다.

 

동일한 역할을 하는 다른 두 개념이 존재한다는 것은 당연하게도, 두 개념이 필요에 따라 선택적으로 사용되거나 함께 사용되어야 하기 때문이다.

 

Example

다음과 같은 시나리오를 상정한다.

 

Red, Blue, Green 이라는 세 가지 노드가 존재한다.

Red, Blue, Green 이라는 세 가지 Pod가 존재한다.

 

우리는 이 상황에서 같은 색의 파드가 같은 색의 노드에만 배치될 수 있도록 하려고한다고 하자.

Taints & Toleration 만 사용한 경우

각 노드에 다음과 같은 Taints를 설정한다.

Red : key = color, value = red, effect = NoSchedule

Blue : key = color, value = blue, effect = NoSchedule

Green : key = color, value = green, effect = NoSchedule

 

이후 각 파드에 다음과 같은 Toleration을 설정한다.

Red : key = color, value = red, effect = NoSchedule

Blue : key = color, value = blue, effect = NoSchedule

Green : key = color, value = green, effect = NoSchedule

 

이렇게 설정하면 각 red, blue, green pod가 red, blue, green node에 배치될 것이라고 예상할 수 있다.

그러나 node가 red, blue, green 외에 존재한다고 가정했을때, 각 pod이 red, blue, green node 중에서만 배치된다고 보장할 수 없다. 따라서 이러한 부분에서 Taints & Toleration의 한계가 드러난다.

 

 

Node Affinity만 사용한 경우

이 경우에는 Taints & Toleration과 반대의 상황을 예상할 수 있다.

 

각 파드는 반드시 label 이 지정된, 자신과 같은 색의 노드에 배치시킬 수 있지만 다른 pod이 자신과 같은 노드에 배치되는 것은 막을 수 없다.

 

따라서 우리의 요구사항을 만족하기 위해서는 Taints & Toleration과 Node Affinity를 동시에 사용해야한다.

'CKA' 카테고리의 다른 글

(TIL) Kubernetes DaemonSet  (0) 2025.03.26
(TIL) Kubernetes에서의 Resource Request & Limits  (0) 2025.03.26
(TIL)Kubernetes의 Node Selector와 Node Affinity  (0) 2025.03.25
(TIL) Taints and Tolerations  (0) 2025.03.25
(TIL) Kubernetes Labels & Selectors  (0) 2025.03.23
    'CKA' 카테고리의 다른 글
    • (TIL) Kubernetes DaemonSet
    • (TIL) Kubernetes에서의 Resource Request & Limits
    • (TIL)Kubernetes의 Node Selector와 Node Affinity
    • (TIL) Taints and Tolerations
    심플코더
    심플코더

    티스토리툴바