Recent Comments
Link
Recent Posts
Today
Total
«   2025/03   »
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
관리 메뉴

Study Memory Work

[K8S/CKA 자격증] Worloads & Scheduling - node 정보보기 본문

Infra/Kubernetes

[K8S/CKA 자격증] Worloads & Scheduling - node 정보보기

Hera Choi 2023. 1. 22. 16:38

Node Taint & Pod Toleration

taint : 어플리케이션 pod를 실행시키게 되면 node의 taint와 매칭이되는 pod toleration이 없는 pod는 taint 되어있는 node에 배치될 수 없다. node의 tain와 동일한 value를 torleration의 value로 가진 pod는 해당 노드에도 scheduling 될 수 있다.

  • node taint, pod toleration
  • worker node에 tain가 설정된 경우 동일 값의 toleration이 있는 Pod만 배치된다.
  • toleration이 있는 Pod는 동일한 taint가 있는 node를 포함하여 모든 node에 배치된다.
  • effect 필드 종류 :
    • NoSchedule : toleration이 맞지 않으면 배치 되지 않는다.
    • PreferNoSchedule : toleration이 맞지 않으면 배치되지 않으나, 클러스터 리소스가 부족하면 할당된다.
    • NoExecute : toleration이 맞으면 동작중인 Pod를 종료.
apiVersion: v1
kind: Pod
metadata:
  name: nginx
  labels:
    env: test
spec:
  containers:
  - name: nginx
    image: nginx
    imagePullPolicy: IfNotPresent
  tolerations:			# 동일한 tain가 있는 node에도 scheduling이 될 수 있다.
  - key: "example-key"
    operator: "Exists"
    effect: "NoSchedule"
 

테인트(Taints)와 톨러레이션(Tolerations)

노드 어피니티는 노드 셋을 (기본 설정 또는 어려운 요구 사항으로) 끌어들이는 파드의 속성이다. 테인트 는 그 반대로, 노드가 파드 셋을 제외시킬 수 있다. 톨러레이션 은 파드에 적용된다. 톨

kubernetes.io

 

 


[문제9] Ready노드 확인하기

작업 클러스터 : hk8s
Ready 상태(NoScheduletaintnode는 제외)node를 찾아 그 수를 /var/CKA2022/notaint_ready_node에 기록하세요.

# 1. 클러스터 체인지
$ kubectl config use-context hk8s


# 2. 모든 node의 ready상태 nodes 보기
$ kubectl get nodes

$ kubectl describe node hk8s-m | grep -i -e taint -e noschedule
$ kubectl describe node hk8s-w1 | grep -i -e taint -e noschedule
$ kubectl describe node hk8s-w2 | grep -i -e taint -e noschedule

# /var/CKA2022/notaint_ready_node 에 기록하기
$ echo 2 > /var/CKA2022/notaint_ready_node