在使用kubectl top pod命令时遇到了error: Metrics API not available 这通常意味着你的集群中没有安装或者正确配置Metrics Server。 Metrics Server是一个集群范围的资源指标数据聚合器,它是Kubernetes的Horizontal Pod Autoscaler和kubectl top命令所依赖的服务。 2、解决方法 1、确认Metrics Server是否已经在集群中安装 ...
针对你遇到的 kubectl top nodes error: metrics api not available 错误,我们可以按照以下步骤进行排查和解决: 1. 确认Kubernetes集群状态 首先,我们需要确保Kubernetes集群本身是健康的。可以通过以下命令检查集群节点的状态: bash kubectl get nodes 确保所有节点都处于 Ready 状态。 2. 检查Metrics Server是否安装并...
[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-...
k8s-app: metrics-server name: metrics-servernamespace: kube-system spec: ports:-name: https port:443protocol: TCP targetPort: https selector: k8s-app: metrics-server---apiVersion: apps/v1 kind: Deployment metadata: labels: k8s-app: metrics-server name: metrics-servernamespace: kube-system ...
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 ...
What happened: After applying the deployment for metrics-server, and adding the --kubelet-insecure-tls arg to the container, I am seeing "Metrics not available for pod xxx" as output to kubectl top pod. What you expected to happen: Metri...
error: Metrics API not available [root@k8scloude1 ~]# kubectl top pods W0109 16:45:58.436117 75718 top_pod.go:140] Using json format to get metrics. Next release will switch to protocol-buffers, switch early by passing --use-protocol-buffers flag ...
第一个报错是因为metrics服务有问题NotFound,第二个自然是因为prometheus需要metrics来收集指标才能生效。
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 ...
写在前面:最近发现集群中的kubectl top node功能不好使了,报错Metrics API not available,检查相关pod状态正常,节点kubelet状态也正常;最后通过github上的issue解决问题,在此记录一下 解决流程: 查看metric-server pod状态 发现是running,问题不出在pod上 进一步查看pod事件,没有事件,未获取到有用的信息 ...