-
kubectl get nodes :查看节点的状态
-
查看Pod的状态:
- kubectl get pod --all -namespaces
- Pending,ContainerCreating,ImagePullBackOff都表明Pod没有就绪,Running才是就绪状态
-
查看Pod的具体情况:
- kubectl describe pod podname
- kubectl describe pod kube-flannel-ds-v0p3x 00 --namesapce=kube-system
-
kubectl get pod --all-namespace -o wide
-
sudo systemctl status kubelet.service:查看kubelet的状态
-
执行命令部署应用:kubectl run httpd-app --image=httpd --replicas=2
-
kubectl get deployment:查看部署的应用
-
kubectl get pod -o wide:查看pod的具体信息
-
kubectl apply -f nginx.yml:创建nginx应用,nginx.yml需要自己创建
-
kubectl delete deployment nginx-deployment或者kubectl delete -f nginx.yml 删除创建的应用
-
kubectl label node k8s-node1 disktype=ssd:标注k8s-node1是配置了SSD的节点
-
通过kubectl get node --show-labels查看节点的label
-
删除label disktype命令:kubectl label node k8s-node1 disktype-
-
kubectl get daemonset --namespace=kube-system:查看守护进程
-
kubectl edit daemonset kube-proxy --namespace=kube-system查看kube-proxy配置
-
kubectl get job 查看Job的状态