安装metrics-server后,pod启动时成功的就是一直报这个错。网上找了很多放法,不管用,可以试试。

 解决方法:新增hostNetwork: true到metries-server.yaml:

参考地址:kubernetes - Error from server (ServiceUnavailable): the server is currently unable to handle the request (get nodes.metrics.k8s.io) - Stack Overflow

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    k8s-app: metrics-server
  name: metrics-server
  namespace: kube-system
spec:
  selector:
    matchLabels:
      k8s-app: metrics-server
  strategy:
    rollingUpdate:
      maxUnavailable: 0
  template:
    metadata:
      labels:
        k8s-app: metrics-server
    spec:
      hostNetwork: true ## 新增

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐