Skip to content
This repository has been archived by the owner on Sep 24, 2021. It is now read-only.

Error with permissions #40

Open
rajeshkodali opened this issue Jul 29, 2020 · 6 comments
Open

Error with permissions #40

rajeshkodali opened this issue Jul 29, 2020 · 6 comments

Comments

@rajeshkodali
Copy link

kubectl get hpa
sqs-consumer-scaler Deployment/<> /30 (avg) 1 10 1 4h

Warning   FailedComputeMetricsReplicas   horizontal-pod-autoscaler                               failed to get <<name>> external metric: unable to get external metric default/<<name>>/nil: unable to fetch metrics from external metrics API: <<name>>.external.metrics.k8s.io is forbidden: User "system:anonymous" cannot list resource "<<resource>>" in API group "external.metrics.k8s.io" in the namespace "default"
@chankh
Copy link
Contributor

chankh commented Aug 4, 2020

looks like it is missing some permissions, did you deploy the full adapter.yaml? There are service account, role bindings defined.

@rajeshkodali
Copy link
Author

Yes, I did.

Here are role bindings and roles:

k8s-cloudwatch-adapter-resource-reader 6d
k8s-cloudwatch-adapter:crd-metrics-reader 6d
k8s-cloudwatch-adapter:external-metrics-reader 6d
k8s-cloudwatch-adapter:system:auth-delegator 6d

@joesbigidea
Copy link

We experienced this issue as well. EKS with K8s 1.14. We reverted to d385146 as that had worked for us in the past with the same setup and it resolved the issue.

@chankh
Copy link
Contributor

chankh commented Aug 7, 2020

Hi @joesbigidea do you mean it worked fine with v0.8.0?

@joesbigidea
Copy link

That's correct, the head version with 0.9.0 gave us this issue:
Warning FailedComputeMetricsReplicas 1s horizontal-pod-autoscaler failed to get external metric <<name>>: unable to get external metric custom-metrics/<<name>>/nil: unable to fetch metrics from external metrics API: <<name>>.external.metrics.k8s.io is forbidden: User "system:anonymous" cannot list resource "<<name>>" in API group "external.metrics.k8s.io" in the namespace "custom-metrics"

Reverting to the version with v0.8.0 resolved the issue. It's working fine with that version.

@rajeshkodali
Copy link
Author

rajeshkodali commented Aug 8, 2020

Digging deeper looks like kiam is blocking the requests. I have created image with curl which gave me hints on what's happening. Now taking it again from the top.

After reverting to previous version, v0.8.0 everything works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants