k8s常用命令

1、查看节点:kubectl get nodes

2、查看所有pod:kubectl get pods -A,必须加-A,不然有些非默认的ns下的pod,看不到

3、进入pod:kubectl exec -it podName -n namespace -- /bin/sh

4、查看k8s集群:kubectl config get-contexts

5、切换k8s集群:kubectl config use-context 集群名

posted @ 2023-01-10 10:30  1234roro  阅读(35)  评论(0)    收藏  举报