[Kubernetes] kubectl command

on_cloud·2023년 3월 22일
0

Kubernetes

목록 보기
3/5
post-thumbnail

kubectl이란?


kubernete cluster에 명령을 내리는 CLI 명령어


install commnad


curl -o kubectl https://s3.us-west-2.amazonaws.com/amazon-eks/1.23.7/2022-06-29/bin/linux/amd64/kubectl
chmod 777 kubectl
mv kubectl /usr/bin

kubectl commnad


apply

kubectl apply -f <file name or URL>

yaml 파일을 실행시킵니다.

get

kubectl get <type> <option>

type을 조회합니다.

create namespcae

kubectl create namespace <namespace name>

namespcae를 생성합니다.

exec

kubectl exec -it <pod id> -- <commnad>

컨테이너에 명령어를 전달합니다.

describe

kubectl describe <type> <resource name>

resource를 조회합니다.

logs

kubectl logs <pod name>

Pod의 log를 조회합니다.

config

kubectl config <command>

명령어 사용법을 조회합니다.

0개의 댓글