https://www.youtube.com/watch?v=3ChtEuiQ2Yg&list=PLApuRlvrZKohaBHvXAOhUD-RxD0uQ3z0c&index=5
참고 유튜브
kubectl [command] [TYPE] [NAME] [flags]
source <(kubectl completion bash)
source <(kubeadm completion bash)
echo "source <(kubectl completion bash)" >> ~/.bashrc
echo "source <(kubeadm completion bash)" >> ~/.bashrc
kubectl --help
kubectl command --help
kubectl run <자원이름> <옵션>
kubectl create -f obj.yaml
kubectl apply -f obj.yaml
kubectl get <자원이름> <객체이름>
kubectl edit <자원이름> <객체이름>
kubectl describe <자원이름> <객체이름>
kubectl delete pod main
kubectl api-resources
kubectl --help
kubectl <명령어> --help: 명령어 도움말 확인kubectl get nodes
kubectl get nodes -o wide: 더 자세한 정보kubectl describe node <node NAME>: 노드에 대한 아주 자세한 정보-o wide와 describe를 잘 기억하자kubectl get pods
kubectl get pods <pod NAME>
kubectl get pods -o wide
kubectl describe pod <pod NAME>
curl <pod IP>:port
apt-get update 후 apt-get install elinks 다운로드 해주면 cli에서 웹 탐색이 가능함kubectl run: 컨테이너를 1개 실행 시 사용하는 명령어kubectl run <name> --image= --port
kubectl run webserver --image=nginx:1.14 --port 80
:버전을 작성하지 않으면 latest 즉 최근 버전이 깔림-a와 같은 옵션 씀kubectl get pods <pod name> -o yaml
kubectl get pods <pod name> -o json
kubectl create deployment: 컨테이너를 여러개 실행 가능한 명령어kubectl create deployment <name> --image=<image> --replicas=<number>
--replicas=: 원하는 수만큼 생성 가능kubectl get deployments.apps: 생성 중인 deployment 확인 가능kubectl describe deployments.apps: 상세한 확인 가능kubectl exec <pod NAME> -it -- /bin/사용하려는 쉘

/usr/share/nginx/html: 안에 웹 문서 저장됨, nginx 기준index.html: 맨 처음 나오게 되는 페이지, 수정하여 master node에서 확인하기
kubectl logs <pod NAME>
kubectl port-forward <pod NAME> 00:00
kubectl edit deployments.apps mainui
kubectl run samplepod --image=nginx:1.14 port:80 --dry-run
kubectl run samplepod --image=nginx:1.14 port:80 --dry-run -o yaml
kubectl run samplepod --image=nginx:1.14 port:80 --dry-run -o yaml > samplepod.pod.yaml



kubectl delete pod <pod NAME>
kubectl delete deployments.app <NAME>
kubectl create -f <file명>
kubectl create -f samplepod.pod.yaml