前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >couldn't get resource list for monitor.tencent.io/v1alpha1: the server is curren

couldn't get resource list for monitor.tencent.io/v1alpha1: the server is curren

原创
作者头像
用户2141488
发布2024-05-06 15:12:38
1410
发布2024-05-06 15:12:38
举报

腾讯云 Serverless 集群

k8s版本:1.24.4

执行命令报错

kubectl cluster-info

代码语言:powershell
复制
C:\Users\admin>kubectl cluster-info
E0506 14:23:47.864588    6328 memcache.go:287] couldn't get resource list for custom.metrics.k8s.io/v1beta1: the server is currently unable to handle the request
E0506 14:23:47.862904    6328 memcache.go:287] couldn't get resource list for monitor.tencent.io/v1alpha1: the server is currently unable to handle the request
E0506 14:23:47.922816    6328 memcache.go:121] couldn't get resource list for monitor.tencent.io/v1alpha1: the server is currently unable to handle the request
E0506 14:23:47.962146    6328 memcache.go:121] couldn't get resource list for custom.metrics.k8s.io/v1beta1: the server is currently unable to handle the request
E0506 14:23:48.005653    6328 memcache.go:121] couldn't get resource list for monitor.tencent.io/v1alpha1: the server is currently unable to handle the request
E0506 14:23:48.050528    6328 memcache.go:121] couldn't get resource list for custom.metrics.k8s.io/v1beta1: the server is currently unable to handle the request
E0506 14:23:48.100011    6328 memcache.go:121] couldn't get resource list for monitor.tencent.io/v1alpha1: the server is currently unable to handle the request
E0506 14:23:48.149735    6328 memcache.go:121] couldn't get resource list for custom.metrics.k8s.io/v1beta1: the server is currently unable to handle the request

分析原因

kubectl describe apiservice v1alpha1.monitor.tencent.io

代码语言:powershell
复制
C:\Users\admin>kubectl describe apiservice v1alpha1.monitor.tencent.io
E0506 14:42:22.161058   11188 memcache.go:287] couldn't get resource list for monitor.tencent.io/v1alpha1: the server is currently unable to handle the request
E0506 14:42:22.189335   11188 memcache.go:287] couldn't get resource list for custom.metrics.k8s.io/v1beta1: the server is currently unable to handle the request
E0506 14:42:22.251846   11188 memcache.go:121] couldn't get resource list for monitor.tencent.io/v1alpha1: the server is currently unable to handle the request
E0506 14:42:22.290652   11188 memcache.go:121] couldn't get resource list for custom.metrics.k8s.io/v1beta1: the server is currently unable to handle the request
E0506 14:42:22.334942   11188 memcache.go:121] couldn't get resource list for monitor.tencent.io/v1alpha1: the server is currently unable to handle the request
E0506 14:42:22.374231   11188 memcache.go:121] couldn't get resource list for custom.metrics.k8s.io/v1beta1: the server is currently unable to handle the request
E0506 14:42:22.418244   11188 memcache.go:121] couldn't get resource list for monitor.tencent.io/v1alpha1: the server is currently unable to handle the request
E0506 14:42:22.456728   11188 memcache.go:121] couldn't get resource list for custom.metrics.k8s.io/v1beta1: the server is currently unable to handle the request
Name:         v1alpha1.monitor.tencent.io
Namespace:
Labels:       <none>
Annotations:  <none>
API Version:  apiregistration.k8s.io/v1
Kind:         APIService
Metadata:
  Creation Timestamp:  2024-04-29T09:28:13Z
  Resource Version:    58225393992
  UID:                 879f173f-753a-46b5-8609-60ae197f04ea
Spec:
  Group:                     monitor.tencent.io
  Group Priority Minimum:    1000
  Insecure Skip TLS Verify:  true
  Service:
    Name:            hpa-metrics-service
    Namespace:       kube-system
    Port:            443
  Version:           v1alpha1
  Version Priority:  15
Status:
  Conditions:
    Last Transition Time:  2024-04-30T07:05:43Z
    Message:               service/hpa-metrics-service in "kube-system" is not present
    Reason:                ServiceNotFound
    Status:                False
    Type:                  Available
Events:                    <none>

可以从 Message 看到是说 hpa-metrics-service 这个service不存在,由此得知是因为现在v1alpha1.monitor.tencent.io

这个apiservice存在,但其关联的service(kube-system/hpa-metrics-service)不存在,导致这个apiservice没法正常工作。

解决办法,删掉 v1alpha1.monitor.tencent.io 这个apiservice

代码语言:powershell
复制
C:\Users\admin>kubectl delete apiservice v1beta1.custom.metrics.k8s.io
E0506 14:48:22.101551   12816 memcache.go:287] couldn't get resource list for custom.metrics.k8s.io/v1beta1: the server is currently unable to handle the request
E0506 14:48:22.205086   12816 memcache.go:287] couldn't get resource list for monitor.tencent.io/v1alpha1: the server is currently unable to handle the request
E0506 14:48:22.266699   12816 memcache.go:121] couldn't get resource list for monitor.tencent.io/v1alpha1: the server is currently unable to handle the request
E0506 14:48:22.310648   12816 memcache.go:121] couldn't get resource list for custom.metrics.k8s.io/v1beta1: the server is currently unable to handle the request
E0506 14:48:22.361500   12816 memcache.go:121] couldn't get resource list for monitor.tencent.io/v1alpha1: the server is currently unable to handle the request
E0506 14:48:22.403837   12816 memcache.go:121] couldn't get resource list for custom.metrics.k8s.io/v1beta1: the server is currently unable to handle the request
E0506 14:48:22.448952   12816 memcache.go:121] couldn't get resource list for monitor.tencent.io/v1alpha1: the server is currently unable to handle the request
E0506 14:48:22.489589   12816 memcache.go:121] couldn't get resource list for custom.metrics.k8s.io/v1beta1: the server is currently unable to handle the request
apiservice.apiregistration.k8s.io "v1beta1.custom.metrics.k8s.io" deleted

同理,monitor.tencent.io/v1alpha1 这个apiservice 也是一样的处理

我们执行 kubectl 命令可以再看报错没有了

代码语言:txt
复制
C:\Users\admin>kubectl get pods
NAME                                READY   STATUS    RESTARTS   AGE
kubernetes-proxy-6dfd6bc689-9qvtd   1/1     Running   0          153m
kubernetes-proxy-6dfd6bc689-l7gml   1/1     Running   0          153m

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
容器服务
腾讯云容器服务(Tencent Kubernetes Engine, TKE)基于原生 kubernetes 提供以容器为核心的、高度可扩展的高性能容器管理服务,覆盖 Serverless、边缘计算、分布式云等多种业务部署场景,业内首创单个集群兼容多种计算节点的容器资源管理模式。同时产品作为云原生 Finops 领先布道者,主导开源项目Crane,全面助力客户实现资源优化、成本控制。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
http://www.vxiaotou.com