Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- NAT
- Chrony
- eigrpv2
- crontab
- stp
- 장비
- GLBP
- OSPF
- DHCP
- tunneling
- ripng
- 스위치
- CKA
- ospfv3
- ipv6
- Inter VLAN
- Vlan
- eigrp
- 헤더
- Redistribute
- Etherchannel
- 명령어
- 라우터
- ACL
- vrrp
- OSI 7 layer
- rip
Archives
- Today
- Total
Net Eng
[CKA] - Node Labels & nodeSelector 본문
[선수 지식]
파드 스케줄링(Pod Scheduling)
* Node Labels/nodeSelector
* Affinity/Antiaffinity
- Node Affinity
- Pod Affinity
* Node Taints, Pod Tolerations
+
* drain
* cordon/uncordon
[선수 작업]
kubectl config set-context k8s --user=kubernetes-admin --cluster=kubernetes
kubectl label node node01 disktype=ssd
[문제]
Schedule a pod as follows:
name: eshop-store
image: nginx
node selector: disktype=ssd
작업 클러스터: k8s
[풀이]
kubectl config use-context k8s
* k8s 클러스터 사용
kubectl get nodes --show-labels
kubectl get nodes -L disktype
* node의 label 확인 (disktype)
kubectl run eshop-store --image=nginx --dry-run=client -o yaml > eshop-store.yaml
* dry-run 명령어로 eshop-store.yaml 파일 생성
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: eshop-store
name: eshop-store
spec:
containers:
- image: nginx
name: eshop-store
resources: {}
nodeSelector:
disktype: ssd
dnsPolicy: ClusterFirst
restartPolicy: Always
status: {}
* yaml 파일에 nodeSelector 항목 추가 (Containers와 같은 레벨)
kubectl apply -f eshop-store.yaml
* yaml 파일 실행
kubectl get pods -o wide
* Pod 실행 확인
[참고]
'Cloud > Kubernetes' 카테고리의 다른 글
[CKA] - Node 정보 수집 (0) | 2024.01.21 |
---|---|
[CKA] - Node 관리 (0) | 2024.01.21 |
[CKA] - Rolling update & Roll Back (0) | 2024.01.19 |
[CKA] - Deployment & Pod Scale (0) | 2024.01.19 |
[CKA] - Side-car Container Pod 생성하기 (0) | 2024.01.19 |