kubernetes基础操作命令

#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

猜你喜欢

转载自blog.51cto.com/476946/2378521