针对你遇到的 kubectl top nodes error: metrics api not available 错误,我们可以按照以下步骤进行排查和解决: 1. 确认Kubernetes集群状态 首先,我们需要确保Kubernetes集群本身是健康的。可以通过以下命令检查集群节点的状态: bash kubectl get nodes 确保所有节点都处于 Ready 状态。 2. 检查Metrics Server是否安装并...
在使用kubectl top pod命令时遇到了error: Metrics API not available 这通常意味着你的集群中没有安装或者正确配置Metrics Server。 Metrics Server是一个集群范围的资源指标数据聚合器,它是Kubernetes的Horizontal Pod Autoscaler和kubectl top命令所依赖的服务。 2、解决方法 1、确认Metrics Server是否已经在集群中安装 ...
kubectl top node报错:Metrics API not available metric-server pod 报错401:Unauthorized //20230810 写在前面:最近发现集群中的kubectl top node功能不好使了,报错Metrics API not available,检查相关pod状态正常,节点kubelet状态也正常;最后通过github上的issue解决问题,在此记录一下 解决流程: 查看metric-server pod...
[root@k8s-master ~]# kubectl top nodes error: Metrics API not available 解决方式 1、下载 metrics-server-components.yaml Bash 复制代码 9 1 wgethttps://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml-Ometrics-server-components.yaml 2、将 metrics-server-...
and then i run 'kubectl top node' get 'error: Metrics API not available' ant then i delete the pod working on agent node , the new pod was allocated back to the server node, the cpu and mem came back Expected behavior: No matter where the metric server is allocated, it should be ...
第一个报错是因为metrics服务有问题NotFound,第二个自然是因为prometheus需要metrics来收集指标才能生效。
[root@k8scloude1 ~]# kubectl top nodes W0109 16:45:38.197980 75467 top_node.go:119] Using json format to get metrics. Next release will switch to protocol-buffers, switch early by passing --use-protocol-buffers flag error: Metrics API not available ...
kubectl get --raw /api/v1/nodes/docker-desktop/proxy/metrics/resource # HELP container_cpu_usage_seconds_total [ALPHA] Cumulative cpu time consumed by the container in core-seconds # TYPE container_cpu_usage_seconds_total counter container_cpu_usage_seconds_total{container="coredns",namespace=...
101d kube-proxy-s4t4j 1/1 Running 42 101d kube-scheduler-k8s01 1/1 Running 25 28d metrics-server-68c49bd448-nfrjs 1/1 Running 0 34m [root@k8s01 k8s-yml]# kubectl get deploy -n kube-system NAME READY UP-TO-DATE AVAILABLE AGE coredns 2/2 2 2 102d metrics-server 1/1 1 1 ...
verbs:-get-apiGroups:-""resources:-pods-nodes verbs:-get-list-watch---apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: labels: k8s-app: metrics-server name: metrics-server-auth-readernamespace: kube-system roleRef: ...