Study Memory Work
[K8S/CKA 자격증] Worloads & Scheduling - node 정보보기 본문
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 상태(NoSchedule로 taint된 node는 제외)인 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
'Infra > Kubernetes' 카테고리의 다른 글
[K8S/CKA 자격증] Worloads & Scheduling - ConfigMap (0) | 2023.01.22 |
---|---|
[K8S/CKA 자격증] Worloads & Scheduling - pod scheduling (0) | 2023.01.22 |
[K8S/CKA 자격증] Worloads & Scheduling - node 관리 (0) | 2023.01.22 |
[K8S/CKA 자격증] Worloads & Scheduling - Deployment (0) | 2023.01.22 |
[K8S/CKA 자격증] Worloads & Scheduling - Pod (3) | 2023.01.20 |