모래성 말고 철옹성

[1분 쿠버네티스] Kube-Scheduler란? Kubernetes Pod 스케줄링 핵심 본문

DevOps/쿠버네티스

[1분 쿠버네티스] Kube-Scheduler란? Kubernetes Pod 스케줄링 핵심

JDhyeok 2025. 8. 17. 15:09

Kube-Scheduler란?

Kube-Scheduler는 Kubernetes에서 Pod가 어떤 노드(Node)에 배치될지 결정하는 스케줄러 컴포넌트이다.

kubectl 명령을 실행하거나, 외부 어플리케이션이 API 요청을 보낼 때, 그 요청들은 가장 먼저 Kube-API Server를 통과하게 된다.

 

Pod는 스스로 실행 위치를 알 수 없기 때문에, 클러스터 내 리소스 상태를 확인하고 가장 적절한 노드에 할당하는 역할을 한다.

 

Kube-Scheduler의 주요 기능

  1. 스케줄링 후보 탐색
    • 실행 가능한 노드 필터링
  2. 자원 조건 확인
    • CPU, Memory 등 하드웨어 리소스 자원 고려
  3. 정책 기반 선택
    • NodeSelector, Node Affinity, Taints & Tolerantions 지원
  4. 우선순위 부여
    • 적합한 노드 점수화 하여 최적의 노드 선택

주요 기능을 톺아봤지만 어디에도 노드 할당하는 명령은 없다. 즉, Kube-Scheduler는 "어디서 실행할지"만 결정하여 "API Server로 Pod의 정의를 갱신한다.

Kube-Scheduler의 동작 원리

  1. 사용자의 새로운 Pod 생성 요청이 etcd에 저장
  2. Kube-Scheduler는 새로 생성된 Pod 감지
  3. 적합한 노드 선택
  4. 선택된 결과를 Kube-API Server에 전달
  5. Kube-API Server는 해당 Node의 Kubelet에 전달
  6. Kubelet이 해당 노드에서 Pod 실행

장애 시 영향

  • 새로운 Pod가 할당되지 않아 클러스터가 정지된 것 처럼 보임
  • 운영 환경에서는 HA 구성 필요

운영 시 고려 사항

  • Node Affinity와 Taints/Tolerations를 적절히 활용하면 특정 워크로드를 특정 노드에 집중 배치하거나 분산시킬 수 있다.
  • 스케줄링 정책 튜닝은 리소스 효율안정적인 운영의 포인트이다.

 

 

즉, Kube-Scheduler는 Kubernetes에서 Pod가 어느 노드에서 실행될지를 결정하는 의사결정하는 역할을 하게 된다.

Pod 위치 결정 = Kube-Scheduler, 실행 = Kubelet.

 

참조.

https://kubernetes.io/docs/concepts/scheduling-eviction/kube-scheduler/

 

Kubernetes Scheduler

In Kubernetes, scheduling refers to making sure that Pods are matched to Nodes so that Kubelet can run them. Scheduling overview A scheduler watches for newly created Pods that have no Node assigned. For every Pod that the scheduler discovers, the schedule

kubernetes.io

 

반응형
Comments