수업내용
Part 1. 쿠버네티스 시작하기
- 쿠버네티스 소개
- 쿠버네티스 설치하기
- 쿠버네티스로 컨테이너 실행하기
Part 2. 쿠버네티스 기본 개념
- 쿠버네티스 아키텍처
- 파드
컨트롤러
- 서비스
- 인그레스
- 레이블과 애너테이션
- 컨피그맵
- 시크릿
Part 3. 쿠버네티스 한 걸음 더 들어가기
- 파드 스케쥴링
- 인증과 권한관리
- 데이터 저장
- 클러스터 네트워킹 구성
- 쿠버네티스 DNS
- 로깅과 모니터링
- 오토스케일링
- 사용자 정의 자원
- 쿠버네티스 기반으로 워드프레스 앱 실행하기
- 헬름
학습내용
- Replication Controller
- ReplicaSet
- Deployment
- DaemonSet
- StatefulSet
- Job
- CronJob
Deployment
- ReplicaSet을 컨트롤해서 Pod수를 조절
- Rolling Update & Rolling Back
Rolling Update란?
롤링 업데이트는 파드 인스턴스를 점진적으로 새로운 것으로 업데이트하여 디플로이먼트 업데이트가 서비스 중단 없이 이루어질 수 있도록 해준다. 새로운 파드는 가용한 자원을 보유한 노드로 스케줄될 것이다.
Deployment definition
ReplicaSet definition과 Deployment definition은 kind(api 이름)만 다름 Deployment로 Rolling Update기능만 사용하지 않으면 ReplicaSet운영하듯 할 수 있다.
ReplicaSet definition
apiVersion:apps/v1
kind: ReplicaSet
metadata:
name: rc-nginx
spec:
replicas: 3
selector:
matchLabels:
app: webui
template:
metadata:
name: nginx-pod
labels:
app: webui
spec:
containers:
- name: nginx-container
image: nginx:1.14
Deployment definition
apiVersion:apps/v1
kind: Deployment
metadata:
name: rc-nginx
spec:
replicas: 3
selector:
matchLabels:
app: webui
template:
metadata:
name: nginx-pod
labels:
app: webui
spec:
containers:
- name: nginx-container
image: nginx:1.14
Deployment Example
cat > deploy-nginx.yaml
apiVersion:apps/v1
kind: Deployment
metadata:
name: rc-nginx
spec:
replicas: 3
selector:
matchLabels:
app: webui
template:
metadata:
name: nginx-pod
labels:
app: webui
spec:
containers:
- name: nginx-container
image: nginx:1.14
kubectl create -f deploy-nginx.yaml
watch kubectl get pods -o wide
kubectl get deployments
kubectl get replicasets
kubectl get pods
kubectl delete deployment deploy-nginx