k8s常用命令汇总
# 重启容器
kubectl rollout restart deployment signgateway -n sign
1
# 查询
kubectl get pods -A: 查看所有的pod
kubectl logs -f ks-install-xxx -n kubesphere-system: 查看某个pod的日志
kubectl describe po ks-installer-xxx -n kubesphere-system: 查看pod具体信息
1
2
3
2
3
# 删除
# Kubernetes强制删除一直处于Terminating状态的pod
kubectl delete pod gitlab-runner-69748fd7b5-96wr6 -n devops --force --grace-period=0
# 批量删除
kubectl get po -n NAMESPACE | grep Terminating
1
2
3
4
5
2
3
4
5
# 参考
上次更新: 2023-08-11 10:16:57