以下是部分常用命令:
更多命令参见:http://docs.kubernetes.org.cn/683.html
| kubectl craete -f xxx-xx.yaml | 创建pods或服务 |
| kubectl get pods xxx | 查看(某个)pods |
| kubectl get svc xxx | 查看(某个)服务 |
| kubectl discribe xx | 查看日志 |
| kubectl delete svc --all | 删除服务 |
| kubectl replace -f xxxx-xx.yaml | 重载pods |
| kubectl delete pods xxxx | 删pods |
| kubectl get nodes | 查看已连接节点 |
| kubectl get cs | 检查集群健康状态 |
| kubectl logs xxx | 某个pod日志 |
| kubectl delete -f xxx.yaml | 通过文件删除 |
| kubectl exec -it xxx /bin/bash | 进入容器终端 |
| kubectl get pod xxx -o wide | 查看容器跑在哪个node上 |
| kubectl port-forward nginx 8080:80 | 更改映射端口 |
| kubectl scale rc xxx -replicas=3 | 动态扩容或缩容 |
| journalctl -l -u kube-proxy | proxy日志 |
| kubectl get pods -n kube-system | 查k8s系统组件运行状态 |
| kubectl get services --all-namespaces | 所有service |
941

被折叠的 条评论
为什么被折叠?



