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

Decouple /metrics endpoint from generic apiserver #801

Closed
dgrisonnet opened this issue Jul 22, 2021 · 7 comments
Closed

Decouple /metrics endpoint from generic apiserver #801

dgrisonnet opened this issue Jul 22, 2021 · 7 comments
Assignees
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature.

Comments

@dgrisonnet
Copy link
Member

What would you like to be added:

I would like metrics-server's /metrics endpoint to be decoupled from the generic apiserver to allow applications only authorized to scrape metrics to be able to scrape metrics-server's /metrics endpoint without requiring apiserver authorization.

Why is this needed:

Metrics-server /metrics endpoint exposes metrics about the server health and these metrics are currently on the same server as the one used to serve the resource metrics API to the apiserver.
This becomes problematic when we want to add authz/authn to metrics scraping since one would have to be authorized by the apiserver in order to access metrics-server's server as well as having the permission to get the /metrics endpoint. Whereas if we were to decouple the /metrics endpoint from the generic API server, the scraper would only have to be authorized to scrape metrics in order to get metrics-server's metrics.

If we were to add authz/authn today without decoupling, we would have to add a kube-rbac-proxy in front of the /metrics and point the scraper to the proxy. It works fine when the request goes from the scraper to the proxy, but from the proxy to the /metrics endpoint, the proxy needs to forward the bearer token used by the apiserver in order to be authorized and this is not in the scope of kube-rbac-proxy which is expected to forward requests to applications without kubernetes awareness.

/kind feature

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 22, 2021
@dgrisonnet
Copy link
Member Author

/help

@k8s-ci-robot
Copy link
Contributor

@dgrisonnet:
This request has been marked as needing help from a contributor.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

/help

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Jul 22, 2021
@fpetkovski
Copy link

/assign

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 14, 2021
@fpetkovski
Copy link

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 15, 2021
@serathius
Copy link
Contributor

PTAL #829 (comment)

@dgrisonnet
Copy link
Member Author

Closing as this can be solved by adding --authorization-always-allow-paths=/metrics as pointed out by @serathius.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants