kubernetes經常使用命令

kubernetes經常使用命令
一、查看類命令
kubectl cluster-info ----查看集羣信息
kubectl -s http://localhost:8080 get componentstatuses ----查看各組件信息
kubectl get pods ----列出當前全部的pod
kubectl get pods -o wide ----查看pods所在的運行節點
kubectl get pods -o yaml ----查看pods定義的詳細信息
kubectl get rc ----查看Replication Controller信息
kubectl get service ----查看service的信息
kubectl get nodes ----查看節點信息
kubectl get pod --selector name=redis ----按selector名來查找pod
kubectl exec pod名 env ----查看運行的pod的環境變量
二、操做類命令
kubectl create -f 文件名 ----建立
kubectl replace -f 文件名  [--force] ----重建
刪除:
kubectl delete -f 文件名
kubectl delete pod pod名
kubectl delete rc rc名
kubectl delete service service名
kubectl delete pod --all
kubectl run mybusybox --image=busybox ----啓動一個pod
kubectl run mybusybox --image=busybox --replicas=5 ----啓動多個pod
kubectl delete deployments mybusybox ----刪除建立的pod
kubectl get pods ----列出當前全部的pod
kubectl describe pod [PODNAME] ----查看pod的狀態
kubectl run mynginx --image=nginx --port=80 --hostport=8000 ----建立帶有端口映射的pod
kubectl run -i --tty busybox --image=busybox ----建立帶有終端的pod
---------------------------------------------------------------
相關文章
相關標籤/搜索