简介
本文档介绍如何处理istiod pod生成的FailedGetResourceMetric
事件。
问题
在使用2023.01云本地部署平台(CNDP)版本部署用户微服务基础设施(SMI)集群后,我们注意到,istiod pod不断生成FailedGetResourceMetric
事件:
cloud-user@ndce-smi-1:~$ kubectl get events -A -o yaml
apiVersion: v1
items:
- apiVersion: v1
count: 467057
eventTime: null
firstTimestamp: "2023-12-31T03:57:42Z"
involvedObject:
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
name: istiod
namespace: istio-system
resourceVersion: "4374"
uid: c85a05a1-b9ec-4241-8347-0b3c9eec1193
kind: Event
lastTimestamp: "2024-03-22T14:42:49Z"
message: 'unable to get metrics for resource cpu: unable to fetch metrics from resource
metrics API: the server could not find the requested resource (get pods.metrics.k8s.io)'
metadata:
creationTimestamp: "2023-12-31T03:57:42Z"
managedFields:
- apiVersion: v1
fieldsType: FieldsV1
fieldsV1:
f:count: {}
f:firstTimestamp: {}
f:involvedObject:
f:apiVersion: {}
f:kind: {}
f:name: {}
f:namespace: {}
f:resourceVersion: {}
f:uid: {}
f:lastTimestamp: {}
f:message: {}
f:reason: {}
f:source:
f:component: {}
f:type: {}
manager: kube-controller-manager
operation: Update
time: "2023-12-31T03:57:42Z"
name: istiod.17a5ce7b410bceb6
namespace: istio-system
resourceVersion: "55452121"
selfLink: /api/v1/namespaces/istio-system/events/istiod.17a5ce7b410bceb6
uid: 9616bdc6-90d1-4475-b6af-6d41e185b434
reason: FailedGetResourceMetric
reportingComponent: ""
reportingInstance: ""
source:
component: horizontal-pod-autoscaler
type: Warning
kind: List
metadata:
resourceVersion: ""
selfLink: ""
分析
此问题似乎是由于部署期间在istiod pod中启用了Horizontal Pod Autoscaler (HPA)。由于HPA需要指标API来确定用于上放/下放Pod的CPU利用率,并且指标API当前未在CNDP管理的Kubernetes群集中使用,因此这是Istiod部署中的设计缺陷。
解决方案
从2023.03 CNDP发布开始,HPA已被删除。