> For the complete documentation index, see [llms.txt](https://close.gitbook.io/yun-wei-bi-ji/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://close.gitbook.io/yun-wei-bi-ji/kubernetes/k8s/wen-ti.md).

# 问题

## 部署METRICS-SERVER时遇到的问题

```bash
[root@k8s-master-1 metrics-server]# kubectl top no
Error from server (ServiceUnavailable): the server is currently unable to handle the request (get nodes.metrics.k8s.io)
```

查看metrics-server日志正常

```bash
[root@k8s-master-1 metrics-server]# kubectl logs -n kube-system deploy/metrics-server 
I0719 11:24:01.344097       1 serving.go:312] Generated self-signed cert (/tmp/apiserver.crt, /tmp/apiserver.key)
I0719 11:24:01.679086       1 secure_serving.go:116] Serving securely on [::]:4443
```

查看kube-apiserver日志，发现：

```bash
v1beta1.metrics.k8s.io failed with: failing or missing response from https://10.96.142.17:443/apis/metrics.k8s.io/v1beta1: Get https://10.96.142.17:443/apis/metrics.k8s.io/v1beta1: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
```

解决方法：在kube-apiserver选项中添加如下配置选项：

```bash
# kubeadm 文件位置： /etc/kubernetes/manifests/kube-apiserver.yaml，二进制自己知道
--enable-aggregator-routing=true
```

```bash
[root@k8s-master-1 metrics-server]# kubectl top node 
NAME           CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%   
k8s-master-1   196m         9%     1284Mi          34%       
k8s-node-1     46m          2%     720Mi           19%       
k8s-node-2     46m          2%     704Mi           19%  
```

## 移除节点无法加入

在被删除的 node 节点中执行，清空集群数据信息。

```bash
kubeadm reset 之后再加入
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://close.gitbook.io/yun-wei-bi-ji/kubernetes/k8s/wen-ti.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
