其他分享
首页 > 其他分享> > 指令

指令

作者:互联网

kubectl get cs #  查看集群状态
kubectl get pods --show-labels # 产看pods标签
kubectl get nodes -o wide # 产看pod信息
kubectl get pods # 获取pods
kubectl get nodes # 获取nodes
kubectl run test -it --rm --image=busybox:1.28.3 # 创建pods
 kubectl get  pods -n kube-system 


kubectl apply -f test.yam # 创建pods

kubectl get pods -o wide
kubectl get svc
kubectl describe svc nginx

kubectl explain svc

kubectl get pods --show-labels # 查看标签名称

kubectl get pod -l env=dev # 根据标签名称查询
kubectl label pod pod名称 标签键值对 # 增加标签名称
kubectl label pod pod名称 key名+- # 删除标签

标签:kubectl,get,--,标签,指令,pod,pods
来源: https://www.cnblogs.com/randysun/p/15595941.html