k8s
CKA 준비 (10) Node 정보 수집
Joon0464
2022. 5. 31. 21:47
이 게시물은 아래 강의를 참고 하였습니다.
참고 강의 https://www.youtube.com/watch?v=KdATmTulf7s&list=PLApuRlvrZKojqx9-wIvWP3MPtgy2B372f&index=1
문제 1)
- Check to see how many nodes are ready (not including nodes tainted NoSchedule) and write the number to /var/CKA2022/RN0001
풀이 1)
- ready 상태인 노드 확인
$ sudo kubectl get nodes | grep -iw ready
- ready 상태인 노드 중 NoSchedule taint를 포함하는 노드인지 확인
-> 문제 의도는 NoSchedule이 포함되어 있으면 Ready 상태로 카운트하지 말라는 뜻이다.
$ sudo kubectl describe node [노드 명] | grep -i noschedule
답 : $ echo "2" > /var/CKA2022/RN0001
문제 2)
- Determine how many nodes in the cluster are ready to run normal workloads (i.e. workloads that do not gave any special tolerations).
- Output this number to the file /var/CKA2022/NODE-Count
풀이)
$ sudo kubectl get nodes | grep -iw ready | wc -l > /var/CKA2022/NODE-Count