. 스케줄러는 pod의 설정 값을 읽어서 nodeName이 없는 경우 자체 스케줄링 알고리즘에 따라 배치하고 값 설정함
. 스케줄러가 없는 경우 pod은 배치되지 못하고 pending 상태로 남음
. pod의 nodeName은 초기 생성에만 지정할 수 있으며, 이후 수정하려면 Binding을 생성해서 직접 node를 추가해야 함
- label: grouping을 위한 사전 준비
- selector: 특정 label을 가진 객체를 선택
- annotations: 정보 저장 용도
- taint: node 기준. 특정 pod를 허용할지 말지 결정
- NoSchedule: 새로 스케줄링 불가능
- PreferNoSchedule: 어쩔 수 없으면 스케줄링
- NoExecute: 이미 존재하는 pod까지 재배치(삭제)
- toleration: pod가 어떤 taint에 배치 가능한지 결정
. 스케줄러는 node에 pod 배치 우선순위 결정, 그 후 taint/toleration에 의해 허용 가능 결정, 허용되지 않으면 다음 순위로
- nodeSelector: pod가 배치될 node의 label 지정. 모두 만족하는 경우에만 배치 (제한적)
- affinity.nodeAffinity: pod기준. 배치될 node의 label을 다양한 조건에 따라 지정
- requiredDuringSchedulingIgnoredDuringExecution: 반드시 따라야 함
- preferredDuringSchedulingIgnoreDuringExecution: 다 찾아보고 없으면 아무데나 배치
. taint/toleration만 사용하는 경우 node에 특정 pod이 배치되도록 보장할 수 없음
. nodeAffinity만 사용하는 경우 node에 특정 pod이 배치되지 않도록 보장할 수 없음
- daemonset: replicaset과 유사하지만 모든 node에 N개씩 배치 보장. 모니터링, 로깅에 주로 사용
- static pod: master node와 통신 없이 자동으로 생성되는 pod. yaml 파일에서 owner가 node로 표시됨. kubelet의 service 파일에 명시된 pod-manifest-path 또는 /var/lib/kubelet/config 파일의 staticPodPath에 존재
. 여러 개의 스케줄러를 사용하고 싶은 경우 KubeSchedulerConfiguration의 leaderElection 옵션 사용 (공식 가이드문서 참고)
'Infra > [강의] CKA with Practice Tests' 카테고리의 다른 글
8. Storage (0) | 2023.01.16 |
---|---|
6. Cluster Maintenance (0) | 2023.01.13 |
5. Application Lifecycle Management (0) | 2023.01.13 |
4. Logging & Monitoring (0) | 2023.01.12 |
2: Core Concepts (0) | 2022.12.20 |