Kubernetes是一种用于自动化部署、扩展和管理容器化应用程序的开源平台,它提供了一种跨节点集群的容器编排解决方案。在使用Kubernetes时,我们经常需要查看集群中的节点信息,以便及时了解集群的状态。在实际操作中,我们可能会遇到“kubectl get nodes no resource”的情况,即在执行kubectl get nodes命令时没有返回任何节点信...
然后创建绑定: kubectl create clusterrolebinding node-server-auto-renew-crt --clusterrole=system:certificates.k8s.io:certificatesigningrequests:selfnodeserver --group=system:nodes 3、手工批准证书请求: 先查询证书请求: [vagrant@localhost etc]$ kubectl get csr NAME AGE REQUESTOR CONDITION csr-2jxvn 76s ...
So turns out I was looking in the wrong place. Logs from kube-proxy and kubelet indicated a networking issue connecting to the API server via the GCP load balancer. I had whitelisted my office IP in the firewall rule which blocked all the nodes. Admittedly I wasn't expecting the nodes t...
3 kubectl get po -n kubernetes-dashboard 3、NAME:指定资源的名称。名称大小写敏感。如果省略名称空间,则显示默认名称空间资源的详细信息或者提示:No resources found in default namespace.。 1 # 示例: 2 [root@k8s-master ~]# kubectl get pods 3 No resources found in default namespace. 4 [root@k8s...
kubectl get nodes -o wide # 获取pod信息,默认是default名称空间 kubectl get pod # 获取pod信息,默认是default名称空间,并查看附加信息【如:pod的IP及在哪个节点运行】 kubectl get pod -o wide # 获取指定名称空间的pod kubectl get pod -n kube-system ...
除了可以看到资源的对象名称外,还可以看到对象的别名,这时候我们再看到别人的命令如kubectl get no这样费解的命令时就可以知道它实际上代表的是kubectl get nodes命令 查看api的版本,很多yaml配置里都需要指定配置的资源版本,我们经常看到v1,beta1,beta2这样的配置,到底某个资源的最新版本是什么呢?
2. 检查节点资源使用情况:kubectl top nodes 网络诊断: 1. 显示命名空间中 Pod 的 IP 地址:kubectl get pods -n-o custom-columns=POD:metadata.name,IP:status.podIP --no-headers 2. 列出命名空间中的所有网络策略:kubectl get networkpolicies -n ...
kubectl get RESOURCE --sort-by=field 该参数用于按照指定的字段对资源进行排序。可以使用各种字段,如名称(name)、创建时间(creationTimestamp)等等。 –no-headers kubectl get RESOURCE --no-headers 该参数用于不显示表格的标题行。 –watch kubectl get RESOURCE --watch 该参数用于持续监视资源的状态变化。当资...
nodes (缩写 no) persistentvolumeclaims (缩写 pvc) persistentvolumes (缩写 pv) pods (缩写 po) podsecuritypolicies (缩写 psp) podtemplates replicasets (缩写 rs) replicationcontrollers (缩写 rc) resourcequotas (缩写 quota) secrets serviceaccounts (缩写 sa) ...
比如,某项目中k8s所在宿主机命名是paas-ip,业务宿主机命名是dynamic-xxx-ip [root@k8s01 ~]# kubectl get nodes NAME STATUS ROLES AGE VERSION k8s01 Ready master 13h v1.19.3 k8s02 Ready node 12h v1.19.3 k8s03 Ready node 12h v1.19.3 ## 查看名称空间 [root@k8s01 ~]# kubectl get namespaces...