其他分享
首页 > 其他分享> > kubectl 常用命令1

kubectl 常用命令1

作者:互联网

查看所有kubelet节点:
kubectl get nodes
kubectl get nodes -o wide --show-labels //可以看到所有节点的label,并且wide参数能看到pod分布情况
kubectl describe node node-name //查看节点的详细信息,包括资源配置等
kubectl get all -n kube-system -l k8s-app=kube-dns
//根据label查找资源,这里查找kube-system域名下k8s-app标签为kube-dns的所有资源
查看所有pod节点:
kubectl get pods --all-namespaces
kubectl get pods -o wide
kubectl get pods -o wide -w //可以看到实时状态变化
watch "kubectl get pods -n kube-system | grep calico" //只看带关键字calico的容器的实时状态变化
kubectl describe pod podname -n namespace
kubectl get -o json pod podname -n namespace
查看daemonset 
kubectl get daemonset --all-namespaces
kubectl describe ds calico-node -n kube-system //查看daemonset的日志

 
 
 

标签:kubectl,get,system,常用命令,pod,kube,wide
来源: https://www.cnblogs.com/vzhangxk/p/15238072.html