아래 Object들은 $ kubectl api-resources
명령어로 확인 가능
Label/LabelSelector
≒ AWS Tag
정보 검색
/ Object-Object 관계 정의
시 사용
k8s는 특정 객체와 다른 특정 개체가 연결되어 연관성을 가짐
ex. Controller ↔️ Pod
Workload🌟
Pod
: 하나 이상의 컨테이너의 그룹
- Controller : Pod 생성 / 제어
- ReplicationController : 복제 (Legacy Workload ➜ Replicasets로 대체)
- ReplicaSets : 복제
- DaemonSets : 데몬과 관련
- Jobs : 배치(batch) 작업 ➜ 시작과 끝이 있는 작업
- CronJobs : 배치 작업
Deployments
: 배포
➜ Replicasets를 관리 (Stateless 대표)
- StatefulSets : Stateful 대표 (Deployments 와 대립)
- HorizontalPodAutoscaler(HPA) : Pod 관리 (Controller로 분류 X)
Network
Service
≒ L4 LB
➜ $ kubectl expose로 서비스 생성
- Endpoints : LB의 백앤드를 정의하고 관리
Ingress
≒ L7 LB
➜ Add-On으로 추가
Storage
- 컨테이너에 Bind든 Volume이든 스토리지 제공
- PersistentVolume(PV) : Volume 정의
- PersistentVolumeClaim(PVC) : Pod가 Volume 사용하기 위한 Claim(요청)
- Pod에 데이터를 제공하기 위한 Key-Value Storage
➜ etcd처럼 대용량 스토리지 x
- ConfigMap
- Secret
Authentication
인증 및 권한
- ServiceAccount (SA)
➜ kubectl이 Cluster에 접속 할 때 인증파일 필요 (~/.kube/*config 파일과 관련)
- RBAC (Role-Based Access Control : 역할기반 접근 제어)
- Role (역할)
- ClusterRole (역할)
- RoleBinding (계정 Account + 역할 연결)
- ClusterRoleBinding (계정 Account + 역할 연결)
Resource Isolation
리소스 분류
- Namespaces
➜ Docker 의 Name Space와 아무 관련 x
Resource Limits
Pod의 리소스 제한
- Limits
- Requests
- ResourceQuota
- LimitRange
Scheduling
파드가 실행될 최상의 Node를 찾음
- NodeName : Node 선택 제약 조건 ➜ Pod를 어떤 Node에 배치할 것인가
- NodeSelector : Pod를 특정 레이블이 있는 Node로 제한
- Affinity : 선호도 (서로 다른 Pod와 Node 간의 관계, Pod-Pod 관계 정의)
- Node Affinity (서로 다른 Pod-Node 간의 관계)
- Pod Affinity (Pod-Pod 관계)
- Pod Anti Affinity (Node에서 이미 실행 중인 Pod Label을 기반으로 Pod가 스케줄될 수 있는 Node를 제한)
- Taints/Tolerations
- Drain/Cordon
- Drain : Node에 존재하는 모든 Pod을 제거 / Pod들을 다른 Node에 새롭게 스케줄링
- Cordon : 지정된 노드에 더이상 포드들이 스케줄링 되지 못하게 막는 것
➜ Drain하면 Cordon이 자동으로 걸림