kubectl get <resource> [-o wide | json | yaml] [-n namespace] 获取资源的相关信息,-n指定命名空间,-o指定输出格式 resource可以是具体资源名称,如"pod nhinx-xxx";也可以是资源类型,如“pod,node,svc,deploy”多种资源使用逗号间隔;或者all(仅展示几种核心资源,并不完整) –all-namespaces或-A:表示...
[root@k8scloude1 1.8+]# kubectl get namespaces NAME STATUS AGE default Active 19h kube-node-lease Active 19h kube-public Active 19h kube-system Active 19h [root@k8scloude1 1.8+]# kubectl get ns NAME STATUS AGE default Active 19h kube-node-lease Active 19h kube-public Active 19h kube...
3. 列出集群中的所有节点:kubectl get nodes 4. 查看一个具体的节点详情:kubectl describe node 5. 列出所有命名空间:kubectl get namespaces 6. 列出所有命名空间中的所有 pod:kubectl get pods --all-namespaces Pod 诊断: 1. 列出特定命名空间中的 pod:kubectl get pods -n 2. 查看一个 Pod 详情:kubectl...
Lookup Namespaces and Security Information Namespacesprovide the mechanism for applications deployed onto a cluster to isolate resources from each other when deployed in a cluster. List all of the namespaces present. Copy kubectl get namespaces-A Example Output: Copy NAME STATUS AGE default Active 55m...
kubectl get命令提供了有关 Kubernetes 中许多事物的信息,包括“吊舱(Pod)”、节点和命名空间。同样,如果没有指定命名空间标志,就会使用默认的命名空间。首先,我获取集群中的命名空间以查看正在运行的命名空间: $kubectl get namespaces NAME STATUS AGE default Active 53m ...
='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.")cmd.Flags().BoolVarP(&o.AllNamespaces,"all-namespaces","A",o.AllNamespaces,"If present, list the requested object(s) across all namespaces. Namespace in ...
#Get commands with basic output#列出所有 namespace 中的所有 service$kubectl get services#列出所有 namespace 中的所有 pod$kubectl get pods --all-namespaces#列出所有 pod 并显示详细信息$kubectl get pods -o wide#列出指定 deployment$kubectl get deployment my-dep#列出该 namespace 中的...
-kubectl get 默认获取当前namespace的资源信息,若需要获取特定namespace中的资源信息,需要指定namespace。指定--all-namespaces可以获取所有namespace上的资源。也可以使用--selector进行过滤具有特定label的资源。 kubectl get pods -o wide kubectl get rc,services ...
# 第三列是APIGROUP组# 第四列是是否属于NAMESPACED资源,就是你可以在ns下面看到的资源# 第五列是kind的时候写的名称# 资源还分子资源,后期会写一篇专门的文章介绍-namespaces/status# 这个是ns状态-namespaces# 这个是ns-persistentvolumes# pvverbs:# verbs是定义动作的-get# 就是可以查看ns的权限-list-watch...
kubectl get rc/web service/frontend pods/web-pod-13je7 选项: -A, --all-namespaces=false: If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.