본문 바로가기
DevOps/DockerKubernetes

kubectl Tips

by 계영수 2022. 9. 16.
728x90

▶ Imperative Commands

"Declarative"

- Define objects using data strucutre such as YAML or JSON

$ kubectl create deployment my-deployment --image=nginx

 

"Imperative"

- Define ojbects using kubectl commands and flags. Some people find imperative commands faster. Experiment and see what works for you!

 

▶ Quick Sample YAML 

- Use the --dry-run flag to run an imperative command without creating an object. Combine it with -o yaml to quickly obtain obtain a sample YAML file you can manipulate!

$ kubectl create deployment my-deployment --image=nginx --dry-run -o yaml

▶ Record a Command

- Use the --record flag to record the command that was used to make a change.

$ kubectl scale deployment my-deployment replicas=5 --record

▶ Use the Docs

You can often find YAML examples in the kubernetes documentation. You are allowed to use this documentation during the exaam. Feel free to copy and paste example YAML and/or commands from the docs!

728x90

'DevOps > DockerKubernetes' 카테고리의 다른 글

kubectl 명령어  (0) 2022.09.15
Backup and Restore etcd  (0) 2022.09.15
YAML 공부하기  (0) 2022.09.04
Pod  (0) 2022.09.04
우분투 리눅스에서 도커 설치  (0) 2022.09.04