리눅스
[kubernetes] kubectl get
변군이글루
2020. 11. 5. 14:15
반응형
kubectl get
$ kubectl get pods,services,deployments -n <namespace>
파드, 서비스, 디플로이먼트 리스트 확인
$ kubectl get pods,services,deployments -n sangchul-nginx
NAME READY STATUS RESTARTS AGE
pod/mynginx 1/1 Running 0 14m
pod/nginx 1/1 Running 0 27m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/dnginx NodePort 10.100.38.133 <none> 80:32156/TCP 6m26s
프로파일에 명령어 등록
###profile
$ vim ~/.bash_profile
...
kget() {
kubectl get pod,service,deployment -o wide -n ${@:-default}
}
###적용
$ source ~/.bash_profile
###kubeget 명령어 실행
$ kget
No resources found in defalut namespace.
$ kget nginx-namespace
No resources found in nginx-namespace namespace.
728x90
반응형