kubernetes-sigs / kubernetes-sigs/controller-runtime
Add readiness check for metrics server when using `WithAuthenticationAndAuthorization()
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 3k
- Forks
- 1.3k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 14
Description
We’ve observed that when using WithAuthenticationAndAuthorization() (with self-signed certs), the metrics server may take a few seconds to become available on Kubernetes 1.33+.
In particular, some Kubebuilder tests started failing against 1.33, where they were still passing in previous versions < 1.33. After debugging, the root cause seems to be a delay related to how Kubernetes 1.33 handles token availability and cert readiness, likely due to changes in the API server behaviour.
To solve our tests for 1.33+ we added a delay: https://github.com/kubernetes-sigs/kubebuilder/pull/4882/files
Just an Idea
It might be nice if controller-runtime could provide a ReadyzCheck for the metrics server. That would help in scenarios using either self-signed or provided certs, by allowing consumers to verify the /metrics endpoint is actually ready (serving over HTTPS and accepting tokens) before probing or testing.
Thanks for your work and for considering this 🙌
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the metrics server path used with WithAuthenticationAndAuthorization() and the existing /metrics endpoint behavior. Compare the readiness expectations with the linked Kubebuilder change for Kubernetes 1.33. Done means consumers can check that the HTTPS metrics endpoint is serving and accepting tokens before probing or testing it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100