Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubectl top nodes 报错 #1417

Open
rgwrgw555 opened this issue Oct 31, 2024 · 1 comment
Open

kubectl top nodes 报错 #1417

rgwrgw555 opened this issue Oct 31, 2024 · 1 comment

Comments

@rgwrgw555
Copy link

What happened? 发生了什么问题?

今天,当我使用kubectl top nodes 来检查节点负载时,我得到了一个错误:"error: Metrics API not available."
我使用了kubectl logs -f -n kube-system metrics-server-xxxxxx 和 systemctl status kube-apiserver-Service -l 查看日志,发现有很多访问失败的记录。
起初我一直认为rbac设置不正确。
经过仔细研究,我们发现是metrics-server端口不可访问。kube-apiserver和metrics-server都会报告如下错误。
909 available_controller. go:460] v1beta1.metrics.k8s. io failed with: failing or missing response from https://172.20.196.137:4443/apis/metrics.k8s.io/v1beta1: Get "https://172.20.196.137:4443/apis/metrics.k8s. io/v1beta1": context deadline exceeded

What did you expect to happen? 期望的结果是什么?

最后,我修改metrics server启动YAML文件:deployment.spec.template.spec.hostNetwork: true
发现问题已经解决。

How can we reproduce it (as minimally and precisely as possible)? 尽可能最小化、精确地描述如何复现问题

已解决问题。

Anything else we need to know? 其他需要说明的情况

No response

Kubernetes version k8s 版本

v1.29.2

Kubeasz version

v3.6.3

OS version 操作系统版本

openEuler release 22.03 (LTS-SP4) ```console # On Linux: $ cat /etc/os-release # paste output here $ uname -a # paste output here ```

Related plugins (CNI, CSI, ...) and versions (if applicable) 其他网络插件等需要说明的情况

@gjmzj
Copy link
Collaborator

gjmzj commented Oct 31, 2024

集群刚刚创建,这个命令确实没有数据的,等一会就会有

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants