K8S常用命令
大约 2 分钟
常用命令
查看所有命令空间
kubectl get ns
查看当前命名空间
kubectl config view --minify --output 'jsonpath={..namespace}'
查看命名空间详情
kubectl describe ns xxxx
查看所有ingress
kubectl get ing
kubectl get ingress
kubectl get ing -o wide --show-labels
查看ingress详情
kubectl describe ing xxx
查看所有的service
kubectl get svc
kubectl get service
kubectl get svc -o wide --show-labels
查看service详情
kubectl describe svc xxx
查看所有pod
kubectl get po
kubectl get pod
kubectl get pods
kubectl get po -o wide --show-labels
查看pod详情
kubectl describe pod xxx
进入pod内部
kubectl exec -it xxx bash
kubectl exec -it xxx sh
查看pod最后n行日志
kubectl logs -f xxxx-podname --tail=100
//100就是从最后100行开始输出
导出yaml文件
kubectl get deployment my-deployment -o yaml
kubectl get svc xxx -o yaml
系统推荐
- 在没有 telnet 和 nc 的世界里,如何优雅地判断端口是否通?
- MySQL杂项
- Btrace入门
- Spring Cloud Gateway收到的是http请求,但schema却是https
- Spring Cloud(一):服务治理技术概览【Finchley 版】
- Thread & ExecutorService & ThreadPoolExecutor 总览
- 线上FullGC频繁的排查
- Docker笔记
- MySQL索引
- gperftools
- SQL优化
- Git历史记录修改用户名和邮箱
- 随机毒鸡汤:你可以在我面前炫富,是在暗示我,以后吃饭钱你付。