controller-runtime
controller-runtime copied to clipboard
Manager should expose http.Handlers to allow extension by users
Based on a conversation we had on the community call on the 18th June 2020:
There are several http.Handler
s set up by the manager that are currently only accessible if served by the manager (metrics and webhooks). If the manager exposed these handlers once constructed this would allow extension by authors to customise how these endpoints are served.
For example, an author could use their own server and serve TLS connections directly instead of using the HTTP only server that is currently implemented with controller-runtime
Or the user could add some HTTP middleware to ensure that all requests to the endpoints are logged in a particular way or authenticated and authorized before serving the content
/milestone Next /help /kind design /priority important-longterm
@vincepri: 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:
/milestone Next /help /kind design /priority important-longterm
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.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale
/remove-lifecycle stale
I still think we should do this at some point
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten
.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten
/remove-lifecycle rotten
Still think this would be useful longer term
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten
.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten
/remove-lifecycle rotten
Still think this is useful, this came up recently in a Cluster API conversation about Kube RBAC proxy (which is where this originally came from as well)
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
/remove-lifecycle stale
/lifecycle frozen (until someone takes this up)
/assign
@umangachapagain Are you still working on this? Otherwise, I could also work on this.
/assign
I see two possible approaches for the API of this.
First, my current attempt, which is exposing/exporting the http.Handlers
and do not let the manager serve individual handlers / endpoints by having dedicated flags for each.
Besides, there could be a complete refactoring which decouples the handlers in exported, stand-alone functions. Which would result in bigger, more involved code-changes, but might be more straight forward to use since no flags are necessary.
Any ideas / preferences for this?
But I think exposing/exporting http.Handlers
is not enough. User might want to also change some configuration of the http.Server
(for example to serve TLS traffic instead of just HTTP). It feels like we should be able to have some kind of callback to allow changing configuration for both http.Server
and http.Handlers
before the server starts.