常用的k8s命令
查看命名空间kubectl get ns查看所有podskubectl get pods -A查看某个命名空间下的podkubectl get pods -n timatrix-algorithm删除命名空间kubectl delete ns timatrix-algorithm查询k8s集群的节点列表命令kubectl get nodes删除pod重启(pod名称,后面根命名空间)kubectl
·
查看版本信息
kubectl version
查看命名空间
kubectl get ns
查看所有pods
kubectl get pods -A
kubectl get pods --all-namespaces
查看某个命名空间下的pod
kubectl get pods -n timatrix-algorithm
删除命名空间
kubectl delete ns timatrix-algorithm
查询k8s集群的节点列表命令
kubectl get nodes
删除pod重启(pod名称,后面根命名空间)
kubectl delete pod middle-youtu-traffic-attribute-traffic-cuda10-101037-54857dl5q7 -n timatrix-algorithm
kubectl delete pod umbrella-hadoop-hdfs-nn-0 umbrella-hadoop-hdfs-nn-1 -n umbrella
k8s进入pod启动的容器所使用的命名
kubectl exec -ti airflow-schedule-0 -n umbrella /bin/bash
kubectl exec -ti middle-body-head-track-cuda10-8975959c9-pvm2s -c middle-body-head-track-cuda10 -n timatrix-algorithm -- /bin/bash
kubectl exec -it uni-svr-6f888cbc-j2lf7 -n timatrix-platform -it -- /bin/bash
k8s指定查看pod的日志命令
kubectl logs middle-face-attribute-cuda10-756bb544dd-zhktf -n timatrix-algorithm middle-face-attribute-cuda10
kubectl logs umbrella-hadoop-hdfs-nn-0 -n umbrella
kubectl logs umbrella-hadoop-hdfs-nn-0 -n umbrella > hdfs-nn-0.log
kubectl logs umbrella-hadoop-hdfs-nn-1 -n umbrella > hdfs-nn-1.log
过滤命令
kubectl get pods -n umbrella | grep kafka
kubectl get pods -n umbrella | grep zookeeper
查看标签
kubectl get nodes --show-labels
kubectl get pods -A --show-labels
查看部署模板
kubectl get deployments -A
kubectl get rs -A
查看任务
kubectl get job -A
kubectl get cronjob -A
查看运行的情况
kubectl describe pod viewlib-manager-575546d569-w6t55 -n timatrix-platform
sip-server问题处理
edit命令进去查看对应的labels,之后在根据labels去对应命名空间中去查找
kubectl edit svc sip-server -n timatrix-platform
kubectl get pod -n timatrix-platform -l qcloud-app=sip-server
查询结果没有找到
产看对应的描述文件
kubectl describe deployment/sip-server -n timatrix-platform
configmap
kubectl get cm -A
kubectl get cm monitor-agent -n timatrix-platform -o yaml
kubectl describe cm face-attribute-config-map -n timatrix-algorithm
更多推荐
已为社区贡献5条内容
所有评论(0)