[CKA] 1일차 - 명령어 정리
- advanced/Devops
- 2022. 8. 4.
Create an NGINX Pod
kubectl run nginx --image=nginx
Generate POD Manifest YAML file (-o yaml). Don't create it(--dry-run)
kubectl run nginx --image=nginx --dry-run=client -o yaml
Create a deployment
kubectl create deployment --image=nginx nginx
Generate Deployment YAML file (-o yaml). Don't create it(--dry-run)
kubectl create deployment --image=nginx nginx --dry-run=client -o yaml
Generate Deployment YAML file (-o yaml). Don't create it(--dry-run) with 4 Replicas (--replicas=4)
kubectl create deployment --image=nginx nginx --dry-run=client -o yaml > nginx-deployment.yaml
Save it to a file, make necessary changes to the file (for example, adding more replicas) and then create the deployment.
kubectl create -f nginx-deployment.yaml
OR
In k8s version 1.19+, we can specify the --replicas option to create a deployment with 4 replicas.
kubectl create deployment --image=nginx nginx --replicas=4 --dry-run=client -o yaml > nginx-deployment.yaml
kubectl run nginx-pod --image=nginx:alpine
'advanced > Devops' 카테고리의 다른 글
[CKA] 5일차 - 클러스터 관리 2(백업 및 복구) (0) | 2022.08.16 |
---|---|
[CKA] 5일차 - 클러스터 관리 (0) | 2022.08.16 |
[CKA] 4일차 - Application Life Cycle (0) | 2022.08.15 |
[CKA] 3일차 - 로깅, 롤링 업데이트 명령어 정리 (0) | 2022.08.12 |
[CKA] 2일차 - 스케쥴링 (0) | 2022.08.08 |