본문 바로가기
cloud/k8s(문제풀이)

[따배쿠CKA]10. Node 정보수집

by mozi2 2022. 8. 9.
반응형
Q. Check Ready Nodes
Check to see how many nodes are ready(not including nodes tainted NoSchedule) and write the number to /var/CKA2022/RN0001

: ready 상태에 있는 것 중 NoSchedule, taint 되어 있는 것들의 수량을 확인해서 /var ~ 해당 경로에 파일을 저장해라

 

1. 확인 

- ready 상태에 있는 노드 확인 
kubectl get nodes | grep -i ready 

: Not Ready 도 폼함되는 것을 확인 할 수 있다. 

 

- Not Ready 는 제외 하고 찾는 방법

  -w 옵션 중요

kubectl get nodes | grep -i -w ready

2. taint 가 NoSchedule 인 항목을 찾기 

kubectl describe node node01[노드이름] | grep -i NoSchedulecd /

-> 해당 노드는 제외

 

4. taint 정보도 확인

kubectl get nodes | grep -i taints

5. ready 상태이고, NoSchedule, taint 노드는 1개이다. 

   -> 이 정보를 " /var/CKA2022/RN0001 " 저장해야함

echo "1" > /var/CKA2022/RN001
cat /var/CKA2022/RN001

 

Q. count the Number of Nodes That Are Ready to Run Normal Worklads
Determine how many nodes in the cluster are ready to run normal workloads (i.e., workloads that do not have any special tolerations).
Output this number to the file /var/CKA2022/NODE-Count

: ready 상태인 노드들이 몇개인지 확인 

 

1. 확인

kubectl get nodes | grep -i -w ready

2. 수량 확인

kubectl get nodes | grep -i -w ready | wc -l

: wc -l 수량 확인 

3. 해당 경로에 파일 만들기 

첫번쨰 방법
kubectl get nodes | grep -i -w ready | wc -l  > /var/CKA2022/NODE-Count

두번째 방법
kubectl get nodes | grep -i -w ready | wc -l 
echo "2" > /var/CKA2022/NODE-Count

* 본 게시글은 "TTABAE-LEARN" 을 보고 정리한 내용입니다.

 

728x90
반응형