본문 바로가기
CKA

CKA - kodekloud Practice Test - Manual Scheduling& Labels and Selectors & Taints and Tolerations & Node Affinity

by 2won2 2025. 6. 23.

Manual Scheduling

  • node가 존재하지 않는 pod에 node 배치
    • vi nginx.yaml
    • nodeName: node01 추가
    • pod delete 후 apply -f => nodeName은 수정 불가 필드이므로, apply 적용이 안됨



Labels and Selectors

  • selector 갯수 확인
    • kubectl get pods --selector env=dev
  • selector 전체 확인
    • kubeclt get all --selector env=dev
  • 다중 조건 검색
    • kubectl get pods --selector env=prod,bu=finance,tier=frontend


Taints and Tolerations

  • key=spray, value=mortein, effect=NoSchedule인 taint 생성
    • kubectl taint nodes node01 spray=mortein:NoSchedule
  • taint 삭제
    • kubectl taint node controlplane node-role.kubernetes.io/control-plane:NoSchedule-
    • kubectl taint node nodename nodekey



Node Affinity

  • label 갯수 확인
    • kubectl describe node name
  • node01에 color=blue 라벨 추가
    • kubectl label node node01 color=blue