针对你遇到的 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是否已经在集群中安装 ...
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-components.yaml中的 k8s.gcr.io 更改为阿里云镜像...
写在前面:最近发现集群中的kubectl top node功能不好使了,报错Metrics API not available,检查相关pod状态正常,节点kubelet状态也正常;最后通过github上的issue解决问题,在此记录一下 解决流程: 查看metric-server pod状态 发现是running,问题不出在pod上 进一步查看pod事件,没有事件,未获取到有用的信息 进一步查看pod...
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 ...
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 [root@k8scloude1 ~]# kubectl top pods ...
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=...
apiGroups, err := o.DiscoveryClient.ServerGroups()//从discoveryClient获取apiGroup if err != nil { return err } metricsAPIAvailable := SupportedMetricsAPIVersionAvailable(apiGroups)//判断metrics是否支持apiGroup metrics := &metricsapi.PodMetricsList{}//创建PodMetricsList对象 ...
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 ...
wget https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml -O metrics-server-components.yaml 解决方法: 部署metrice-server 官网yaml文件 apiVersion: v1 kind: ServiceAccount metadata: labels: k8s-app: metrics-server ...