5.k8s基本命令汇总

1. Deployment创建和删除

创建Deployment
kubectl create -f test.yaml

删除Deployment
kubectl delete -f test.yaml
kubectl delete deployments  *** -n --all-namespaces

查看Deployment
kubectl get deployments --all-namespaces

 

2. Service的创建查看

查看
kubectl get services --all-namespaces

创建
kubectl create -f test.yaml

删除
kubectl delete service *** -n default

 

3. pod的查看,删除

# pod的查看
kubectl get pod --all-namespaces
kubectl get pod --all-namespaces -o wide (查看更多的信息)
# 查看具体某一个mod的信息
kubectl describe pod **** -n kube-system

# 删除pod
kubectl delete pod **** -n kube-system

 

4. 查看k8s日志

journalctl -f -u kubelet.service

 

5. 查看pod节点的状态

kubectl describe pod kube-flannel-ds-amd64-zfkgl -n kube-system

 

posted @ 2020-05-03 06:30  盛开的太阳  阅读(392)  评论(0编辑  收藏  举报