1 wa <1> EKS에서 실습 # 터미널 1 k ns wa 2 # 터미널 2 mkdir 60 cd 60 Kubectl 커맨드 실행 예제 다음은 kubectl 명령어의 실행 예제와 그에 대한 설명입니다. kubectl run nginx --image=nginx # 이미지를 사용하여 nginx 파드를 실행합니다. kubectl get pods # 현재 실행 중인 파드의 목록을 확인합니다. kubectl describe pod nginx: nginx # 파드의 세부 정보를 출력합니다. kubectl logs nginx # 파드의 로그를 출력합니다. kubectl exec -it nginx -- /bin/bash # 파드 내에서 대화형 셸을 실행합니다. root@nginx:/# ls root@nginx:/# exit kubectl delete pod nginx # 파드를 삭제합니다. 3 cat < my-nginx.yaml apiVersion: v1 kind: Pod metadata: name: my-first-pod labels: app: web spec: containers: - name: nginx-container image: nginx:latest ports: - containerPort: 80 EOF 4 kubectl apply -f my-nginx.yaml 5 kubectl get pods -o wide 6 kubectl delete -f my-nginx.yaml 7 kubectl cluster-info 8 kubectl get nodes -o wide Kubernetes control plane is running at https://73BC357AD10975C3B4E2FA9556D4B9A2.gr7.ap-northeast-2.eks.amazonaws.com CoreDNS is running at https://73BC357AD10975C3B4E2FA9556D4B9A2.gr7.ap-northeast-2.eks.amazonaws.com/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy 9 kubectl get pods -n kube-system 10 kubectl config current-context heast-2:147544871824:cluster/free-vpc-cluster:monitoring) [root@kops-ec2 ~]# kubectl config current-context arn:aws:eks:ap-northeast-2:147544871824:cluster/free-vpc-cluster (arn:aws:eks:ap-northe ------------------- # 삭제 kubectl delete pod nginx kubectl delete all --all eksctl delete cluster --name free-vpc-cluster --region ap-northeast-2