kubernetes 基础命令及操作

获取集群的基本信息
kubectl cluster-info
kubectl get nodes
kubectl get namespaces
kubectl get deployment --all-namespaces
kubectl get svc --all-namespaces
kubectl get pod
kubectl get pod -o wide --all-namespaces
kubectl logs podName
创建pod或srv
kubectl create -f development.yaml
检查将要运行的 Pod 的资源状况
kubectl describe pod podName
删除 Pod
kubectl delete pod podName
pod有多少副本
kubectl get rc
扩展 Pod
kubectl scale --replicas=3 rc podName
删除
kubectl delete deployment kubernetes-dashboard --namespace=kube-system
kubectl delete svc kubernetes-dashboard --namespace=kube-system
kubectl delete -f kubernetes-dashboard.yaml
进入pod
kubectl exec -ti podName /bin/bash

posted @ 2017-07-28 11:22  Mr黄瑞  阅读(1688)  评论(0编辑  收藏  举报