Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[prometheus-node-exporter] Add permissions for 'CustomResources' with 'extraRules' #5066

Open
Alja9 opened this issue Dec 16, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Alja9
Copy link

Alja9 commented Dec 16, 2024

Is your feature request related to a problem ?

I use kubeRBACproxy to make metrics endpoint to https and I install node-exporter in different cluster from prometheus. And I use serviceaccount token for auth. But the error that always appears is Forbidden when trying to curl https metrics from different cluster.

Describe the solution you'd like.

When the node-exporter installation is finish, there is a note like this :

kube-rbac-proxy endpoint protections is enabled:
- Metrics endpoints is now HTTPS
- Ensure that the client authenticates the requests (e.g. via service account) with the following role permissions:
rules:
  - apiGroups: [ "" ]
    resources: ["services/prometheus-node-exporter"]
    verbs:
      - get

So temporary solution, I need to manually add those rules to the node-exporter clusterrole to allow the serviceaccount token to working well.
Possible solution: Add permissions for CustomResources' apiGroups in Role/ClusterRole. Should be used in conjunction with Custom Resource State Metrics configuration.

Describe alternatives you've considered.

Add extraRules: [] in rbac section

Additional context.

No response

@Alja9 Alja9 added the enhancement New feature or request label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant