Notice
Recent Posts
Recent Comments
Link
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Archives
Today
Total
관리 메뉴

전공공부

Taints And Tolerations 본문

Study/K8S

Taints And Tolerations

monitor 2023. 3. 19. 21:06

1. Taint - Node

- 노드가 두는 제한

 

kubectl taint nodes node-name key=value:taint-effect

taint-effect는 Taint를 견디지 못하는 Pod가 할당 되었을때의 정책을 제시합니다.

 

taint-effect : [Noschedule | PreferNBoSchedule | NoExecute]

 

1-1) Taint - NoExecute

- Taint의 제한이 걸려서 실행이 되지 않고 Terminate 되는 Pod가 있을 수 있다. 

 

예시)

kubectl taint nodes node1 app=blue:NoSchedule

 


2. Toleration - Pods

- 명시적으로 Toleration 되어진 Pod만 Taint된 노드 에 접근 할 수 있게 됌

 

2-1) Toleration 지정

kubectl taint nodes node1 app=blue:NoSchedule

위와 같이 설정된 taint를 참고하여 pod Toleration을 지정 할 수 있다.

 

pod-definition.yaml

 

apiVersion:
kind: Pod
metadata: 
  name: myapp-pod
spec:
  containers:
    - name: nginx-containers
      image: nginx
  tolerations:
    - key: "app"
      operator: "Equal"
      value: "blue"
      effect: "NoSchedule"

Tip

 

- Master Node에 Application Pod가 설치 되어지지 않는 이유가 위와 같이 Taint와 Toleration 설정으로 인한 것이다./

'Study > K8S' 카테고리의 다른 글

Multi-Container PODs  (0) 2023.03.26
Node Selectors & Node Affinity  (0) 2023.03.22
Resource Requirements  (0) 2023.03.19
Service Account  (2) 2023.03.19
Docker Security  (0) 2023.03.19