Sau khi upgrade k8s lên version 1.23 thì mình bắt đầu gặp lỗi trong HPA
không mấy được cpu utilization
failed to get cpu utilization: unable to get metrics for resource cpu: unable to fetch metrics from resource metrics API: an error on the server ("Internal Server Error: \"/apis/metrics.k8s.io/v1beta1/namespaces/staging-nimtechnology/pods?labelSelector=app%3Dnimtechnology\": the server could not find the requested resource") has prevented the request from succeeding (get pods.metrics.k8s.io)
Không lấy được memory utilization
failed to get memory utilization: unable to get metrics for resource memory: unable to fetch metrics from resource metrics API: an error on the server ("Internal Server Error: \"/apis/metrics.k8s.io/v1beta1/namespaces/stagingnimtechnology/pods?labelSelector=app%3Dnimtechnology\": the server could not find the requested resource") has prevented the request from succeeding (get pods.metrics.k8s.io)
Trong log của con metrics-server trong namespace: kube-sysem
E0317 08:06:29.466482 1 webhook.go:196] Failed to make webhook authorizer request: the server could not find the requested resource E0317 08:06:29.466586 1 errors.go:77] the server could not find the requested resource
How to fix the issue.
Apply version mới nhất của metrics-server.
https://github.com/kubernetes-sigs/metrics-server/releases