kubectl get node //獲得 部署節點
kubectl get ns //獲得 Namespace
kubectl get pods //pod
kubectl get pods -o wide //正在運行的pod
kubectl get pods -n storage-system |grep lcmapi //查詢pod
kubectl delete pods -n storage-system lcmapi-7cf4bd8f45-27gpv lcmapi-7cf4bd8f45-m86f7 lcmapi-7cf4bd8f45-wmh2g //刪除多個pod
kubectl get pods --show-labels
kubectl get pods --all-namespaces
kubectl describe pods/<pod-name> //顯示pod的詳細信息
kubectl describe nodes <node-name> //顯示node的詳細信息
kubectl get endpoints // 查看所有的endpoints
kubectl logs <pod-name> # 查看容器的日誌
kubectl logs -f <pod-name> # 實時查看日誌
kubectl edit deployment umstor-rgw-customer -n storage-system //修改對應的 deployment
kubectl get service -n storage-system | grep umstor-rgw
kubectl exec -it lcmapi-fb8f8cb69-7lfqn -n storage-system bash //進入對應的POD裏面
kubectl get pods -n storage-system | grep lcmapi // 查看lcmapi的POD名稱
kubectl exec -it lcmapi-7cf4bd8f45-pz8sp -n storage-system bash //進入LCM的pod容器內
for lcm in $(kubectl get pods -n storage-system | grep lcmapi | awk '{ print $1 }'); do kubectl logs -n storage-system -f --tail=200 $lcm; done //查看日誌