K8S常用命令(使用向)

1. 查看命名空间

kubectl get ns

2. 查看指定命名空间的pod

kubectl get po -n xxxx

查看特定的pod

kubectl get pod -n "ns"| grep xxxx

3. 进入pod

kubectl exec -it xxxxxx -n "ns" bash

一个pod 就是一个单独的环境,可以看做是一个虚拟机,可以正常执行Linux命令

4. 查看 pod 日志

kubectl logs xxxxxx -n "ns"

5. 查看pod 的总体情况

kubectl describe pod xxxxx -n "ns"

猜你喜欢

转载自blog.csdn.net/YuannaY/article/details/131212967