kubernetes-sigs / kubernetes-sigs/controller-runtime
Feature: Priority Queue
@alvaroaleman is already working on this.
Since Nov 16, 2024.
- Dominant language
- Go
- Stars
- 3k
- Forks
- 1.3k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 14
Description
Tasks
- v0.20
- v0.21
- https://github.com/kubernetes-sigs/controller-runtime/pull/3156
- https://github.com/kubernetes-sigs/controller-runtime/pull/3103
- https://github.com/kubernetes-sigs/controller-runtime/pull/3075
- https://github.com/kubernetes-sigs/controller-runtime/pull/3162
- https://github.com/kubernetes-sigs/controller-runtime/pull/3168
- https://github.com/kubernetes-sigs/controller-runtime/pull/3167
- https://github.com/kubernetes-sigs/controller-runtime/pull/3111
- https://github.com/kubernetes-sigs/controller-runtime/pull/3152
- https://github.com/kubernetes-sigs/controller-runtime/pull/3160
- https://github.com/kubernetes-sigs/controller-runtime/pull/3174
- v0.22
- https://github.com/kubernetes-sigs/controller-runtime/pull/3289
- https://github.com/kubernetes-sigs/controller-runtime/pull/3290
- https://github.com/kubernetes-sigs/controller-runtime/pull/3250
- https://github.com/kubernetes-sigs/controller-runtime/pull/3243
- https://github.com/kubernetes-sigs/controller-runtime/pull/3371
- v0.23 (enabled per default)
- https://github.com/kubernetes-sigs/controller-runtime/pull/3337
- https://github.com/kubernetes-sigs/controller-runtime/pull/3333
- https://github.com/kubernetes-sigs/controller-runtime/pull/3332
- https://github.com/kubernetes-sigs/controller-runtime/pull/3330
- https://github.com/kubernetes-sigs/controller-runtime/pull/3336
- https://github.com/kubernetes-sigs/controller-runtime/pull/3350
- https://github.com/kubernetes-sigs/controller-runtime/pull/3368
- https://github.com/kubernetes-sigs/controller-runtime/pull/3387
- https://github.com/kubernetes-sigs/controller-runtime/pull/3395
- https://github.com/kubernetes-sigs/controller-runtime/pull/3408
- https://github.com/kubernetes-sigs/controller-runtime/pull/3415
- https://github.com/kubernetes-sigs/controller-runtime/pull/3416
- https://github.com/kubernetes-sigs/controller-runtime/pull/3419
Ideas:
- Add Priority parameter to reconcile.Request (xref: https://github.com/kubernetes-sigs/controller-runtime/pull/3013#discussion_r1850435612)
- Won't implement until we have a clear use case for it
Feature enablement
The feature can be enabled by setting the UsePriorityQueue option to true, e.g.:
ctrlOptions := ctrl.Options{
Controller: config.Controller{
UsePriorityQueue: ptr.To[bool](true),
},
...
}
mgr, err := ctrl.NewManager(restConfig, ctrlOptions)
Original issue description
While discussing https://github.com/kubernetes-sigs/controller-runtime/issues/857#issuecomment-1587149384 an idea come up about having something like a priority queue, so we can give resync events a lower priority while assigning to other events a higher priority.
This could help when there are many objects of the same type and at every resync period there is a storm of events being added to the queue.
cc @alvaroaleman @sbueringer
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.
Assessment
This issue has not been assessed yet.