Skip to content

why i got an error:"F0923 17:02:39.416565 20966 helpers.go:114] Error from server (Forbidden): work-queue-length.custom.metrics.k8s.io is forbidden: User "system:anonymous" cannot list resource "work-queue-length" in API group "custom.metrics.k8s.io" in the namespace "default""" #68

Closed
@qiuhongshuai

Description

@qiuhongshuai

I deployed the adapter according to the test-adapter directory and setup successfully.
I can get metricsvaluelist(command is: kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta1"). But when try to get a certain metricsValue(command is: kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta1/namespaces/default/work-queue-length" ) ,I got the error like above,and the log show that : "I0923 08:55:11.715408 1 request.go:1068] Response Body: {"kind":"SubjectAccessReview","apiVersion":"authorization.k8s.io/v1","metadata":{"creationTimestamp":null},"spec":{"resourceAttributes":{"namespace":"default","verb":"list","group":"custom.metrics.k8s.io","version":"v1beta1","resource":"work-queue-length"},"user":"system:anonymous","groups":["system:unauthenticated"]},"status":{"allowed":false}}"
How can I change the user when I make a SubjectAccessReview request? why the user is system:anonymous?

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions