可以通过 --all-namespaces 获取 k8s 集群所有的 serivce 列表: kubectl get svc --all-namespaces 1. 同样,像获取 deploy、pod、ingress、configmap 等等也都适用 --all-namespaces 。 也可以通过 -n <namespace> 获取指定 namespace 下的 service 列表: kubectl get svc -n public 1. 3、备份 service 内容...
kubectl get -o template pod/kube-dns-795f5f6f9c-ldxxs --template {{.status.phase}} # 同时获取所有的 rc 和 service kubectl get rc,services # 获取符合条件的所有 rc,svc,pod kubectl get rc/web service/frontend pods/web-pod-13cd8 # 获取所有 resource kubectl get all kubectl edit 使用默认...
kubectl create deployment nginx-test --image=nginx:1.14 --replicas=3 kubectl get pods,deploy -o wide 1. 2. 1.2、发布服务 kubectl expose deploy nginx-test --port=80 --target-port=80 --name=nginx-service --type=NodePort kubectl get svc -o wide 1. 2. 1.3、查看nginx版本 curl -I 192....
$ kubectl get svc -n kube-system 查看命名空间 $ kubectl get ns $ kubectl get namespaces 查看所有pod所属的命名空间 $ kubectl get pod --all-namespaces 查看所有pod所属的命名空间并且查看都在哪些节点上运行 $ kubectl get pod --all-namespaces -o wide 查看目前所有的replica set,显示了所有的pod的...
kubectl get pod --all-namespaces 获取所有命名空间下的运行的所有Pod的标签: kubectl get pod --show-labels 获取该节点的所有命名空间: kubectl get namespace 说明: 类似可以使用“kubectl get svc”,“kubectl get nodes”,“kubectl get deploy”等获取其他资源的信息。
kubectl get pod --all-namespaces To obtain the labels of all pods running in all namespaces: kubectl get pod --show-labels To list all namespaces of the node: kubectl get namespace NOTE: Similarly, you can run thekubectl get svc,kubectl get nodes, andkubectl get deploycommands to obtain ...
# 查看子命令帮助信息 kubectl get --help # 列出默认namespace中的所有pod kubectl get pods # 列出指定namespace中的所有pod kubectl get pods --namespace=test # 列出所有namespace中的所有pod kubectl get pods --all-namespaces # 列出所有pod并显示详细信息 kubectl get pods -o wide kubectl get replica...
# Get commands with basic output# 列出所有 namespace 中的所有 service$ kubectl get services # 列出所有 namespace 中的所有 pod$ kubectl get pods --all-namespaces # 列出所有 pod 并显示详细信息$ kubectl get pods -o wide # 列出指定 deployment...
namespaces ns 命名空间 deployments deploy deploy services svc svc ingresses ing cronjobs cj events ev replicationcontrollers rc 通过get命令可以查看这些资源信息 查看node状态 [root@node01 ~]# kubectl get node NAME STATUS ROLES AGE VERSION master Ready control-plane,master 25h v1.23.9 ...
-kubectl get 默认获取当前namespace的资源信息,若需要获取特定namespace中的资源信息,需要指定namespace。指定--all-namespaces可以获取所有namespace上的资源。也可以使用--selector进行过滤具有特定label的资源。 kubectl get pods -o wide kubectl get rc,services ...