k8s基础操作
[toc]
查看k8s中所有命名空间里面的pod
kubectl get pod -A
或 kubectl get pod --all-namespaces
字段 | 说明 |
---|---|
NAMESPACE | pod所属的命名空间 |
NAME | pod的名称 |
READY | 表示pod是否就绪(Ready)的状态 格式为 当前就绪的容器数量/总容器数量 |
STATUS | 表示pod的当前状态。常⻅的状态有Running(运行中)、Pending(等待中)、CrashLoopBackOff(崩溃循环中)、Error(错误)、Backoff(反复错误)、Terminating(正在删除) |
RESTARTS | 表示pod重启的次数 |
AGE | 表示pod创建的时间,以时间单位(如小时、分钟或秒)的格式显示 |
$ kubectl get pod -A
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-5d78c9869d-26wvz 1/1 Running 0 3m39s
kube-system coredns-5d78c9869d-ns7rp 1/1 Running 0 3m46s
kube-system etcd-ops-ingress-control-plane 1/1 Running 0 3m33s
kube-system kindnet-8j6nh 1/1 Running 0 3m30s
kube-system kindnet-bv6bj 1/1 Running 0 3m31s
kube-system kindnet-p568d 1/1 Running 0 3m26s
kube-system kindnet-wsgkj 1/1 Running 0 3m28s
kube-system kube-apiserver-ops-ingress-control-plane 1/1 Running 0 3m26s
kube-system kube-controller-manager-ops-ingress-control-plane 1/1 Running 0 2m55s
kube-system kube-proxy-gqghp 1/1 Running 0 3m21s
kube-system kube-proxy-k9j7w 1/1 Running 0 3m24s
kube-system kube-proxy-q7gwp 1/1 Running 0 3m22s
kube-system kube-proxy-x5w8c 1/1 Running 0 3m19s
kube-system kube-scheduler-ops-ingress-control-plane 1/1 Running 0 2m22s
local-path-storage local-path-provisioner-6bc4bddd6b-7jwxg 1/1 Running 0 67s