prometheus-adapter cannot create resource subjectaccessreviews
Issue
kube-controller-manager pods show errors such as the following related to the HorizontalPodAutoscaler:
2021-01-06T20:14:39.824081179Z E0106 20:14:39.824034 1 horizontal.go:227] failed to compute desired number of replicas based on listed metrics for Deployment/<...>/<...>: invalid metrics (1 invalid out of 1), first error is: 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/<...>/pods?labelSelector=app%3D<app-name>\": subjectaccessreviews.authorization.k8s.io is forbidden: User \"system:serviceaccount:openshift-monitoring:prometheus-adapter\" cannot create resource \"subjectaccessreviews\" in API group \"authorization.k8s.io\" at the cluster scope") has prevented the request from succeeding (get pods.metrics.k8s.io)
2021-01-06T20:14:39.825723021Z I0106 20:14:39.825635 1 event.go:278] Event(v1.ObjectReference{Kind:"HorizontalPodAutoscaler", Namespace:"<...>", Name:"<...>", UID:"49859332-2f91-49fd-a63f-b022b0ae0b86", APIVersion:"autoscaling/v2beta2", ResourceVersion:"319356311", FieldPath:""}): type: 'Warning' reason: 'FailedComputeMetricsReplicas' invalid metrics (1 invalid out of 1), first error is: 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/<...>/pods?labelSelector=app%3D<app-name>\": subjectaccessreviews.authorization.k8s.io is forbidden: User \"system:serviceaccount:openshift-monitoring:prometheus-adapter\" cannot create resource \"subjectaccessreviews\" in API group \"authorization.k8s.io\" at the cluster scope") has prevented the request from succeeding (get pods.metrics.k8s.io)
Environment
- Red Hat OpenShift Container Platform
- 4.5
- 4.6
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.