看Node资源使用情况
kubectl describe nodes

查看所有pod
kubectl get pods --all-namespaces

查看指定namespace的pod
kubectl get pod -n namespace

查询所有service
kubectl get svc --all-namespaces

查看指定namespace的service
kubectl get service -o wide -n namespace

查看服务
kubectl get svc -n kubeflow
kubectl get svc istio-ingressgateway -n istio-system

编辑服务
kubectl -n kubeflow edit svc ml-pipeline-ui
kubectl -n istio-system edit svc istio-ingressgateway

查看服务所在节点
kubectl get pod -n istio-system -o wide | grep istio-ingressgateway
kubectl get pod -n kubeflow -o wide | grep ml-pipeline-ui

查询deployment的yaml
kubectl get deploy activator -n knative-serving -o yaml

查询service的yaml
kubectl get svc mysql -o yaml -n kubeflow

查看指定namespace的pod的日志
kubectl logs workflow-controller-85c665bcb9-gvlv9 -n kubeflow
kubectl logs -f workflow-controller-85c665bcb9-gvlv9 -n kubeflow

查看指定namespace的pod的描述
kubectl describe pod workflow-controller-85c665bcb9-gvlv9 -n kubeflow

编辑指定namespace的pod
kubectl edit statefulset admission-webhook-bootstrap-stateful-set -n kubeflow
kubectl edit deployment admission-webhook-deployment -n kubeflow

删除指定namespace的pod
kubectl delete pod ml-pipeline-8479cb4d66-7ljs8 --grace-period=0 --force -n kubeflow

进入指定namespace的pod
kubectl exec -it argo-ui-6754c76f9b-8hbx6 -n kubeflow sh

查询指定namespace的pvc的yaml
kubectl get pvc minio-pv-claim -n kubeflow -o yaml

查询所有pv和pvc
kubectl get pv
kubectl get pvc

查询指定namespace的pv、pvc的描述
kubectl describe pvc minio-pv-claim -n kubeflow
kubectl describe pv kubeflow-pv2

删除指定namespace的pv、pvc
kubectl delete pv pvname
kubectl delete pvc pvcname

查看kubelet日志
journalctl -xeu kubelet
journalctl -f -u kubelet.service

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐