kubectl(7)
-
pod 이름 변수값으로 설정하기
# bashPOD_NAME=$(kubectl get pod -l app=fastapi -n fastapi -o jsonpath="{.items[0].metadata.name}")kubectl delete pod/$POD_NAME -n fastapi
2025.03.29 -
kubectl pod 찾기
kubectl get pods -l app=schema-registry -n {namespace}kubectl logs -f -n {namespace}
2025.03.09 -
kubectl context 정보 가져오기
kubectl config get-contexts# 현재 설정정보 가져오기kubectl config current-context# context 변경kubectl config use-context
2025.02.22 -
k8s namespace 생성
명령어 사용kubectl create namespace {namespace}yml 사용# namespace.ymlapiVersion: v1kind: Namespacemetadata: name: {namespace} # 실행kubectl apply -f namespace.yml
2025.02.07 -
디버깅에 유용한 명령어
# yml 파일 생성vi {yml파일}# yml 파일 실행kubectl apply -f {yml파일}# 실행결과 확인kubectl get pods -Akubectl get pods -n {namespace}# pod 재기동kubectl delete pod/{pod} -n {namespace}# 로그 보기kubectl logs -f {pod} -n {namespace}kubectl logs -f service/{service} -n {namespace}kubectl logs -f ingress/{ingress} -n {namespace}kubectl logs -f ingress/{ingress} -n {namespace} -c {container}# 이벤트 확인kubectl get event -Akubec..
2024.05.05 -
Window에 kubectl 설치 및 minikube 연결하기
kubeclt 설치 # 파일 다운로드 curl.exe -LO "https://dl.k8s.io/release/v1.26.0/bin/windows/amd64/kubectl.exe" # 파일 옮기기 copy kubectl.exe C:\Windows\System32\ minikube 연결 # 서버의 파일 환경 파일 복사 scp 계정@192.168.0.28:/home/계정/.kube/config C://Users/계정/.kube/ # 환경변수 등록 KUBECONFIG=C://Users/계정/.kube # 명령실행 # 에러 발생 kubectl get pods ---------------------------- Error in configuration: * unable to read client-cert .\.mi..
2023.03.01