feat: add configurable sync period for kubelet endpoints controller#7762
Merged
simonpasquier merged 3 commits intoprometheus-operator:mainfrom Aug 4, 2025
Merged
Conversation
Add --kubelet-sync-period flag to allow customization of how often the kubelet endpoints controller syncs with the Kubernetes API. Default remains 3 minutes to maintain backward compatibility.
cmd/operator/main.go
Outdated
| fs.Var(&nodeAddressPriority, "kubelet-node-address-priority", "Node address priority used by kubelet. Either 'internal' or 'external'. Default: 'internal'.") | ||
| fs.BoolVar(&kubeletEndpointSlice, "kubelet-endpointslice", false, "Create EndpointSlice objects for kubelet targets.") | ||
| fs.BoolVar(&kubeletEndpoints, "kubelet-endpoints", true, "Create Endpoints objects for kubelet targets.") | ||
| fs.DurationVar(&kubeletSyncPeriod, "kubelet-sync-period", 3*time.Minute, "Sync period duration for updating kubelet endpoints (e.g., 10s, 2m, 1h30m).") |
Contributor
There was a problem hiding this comment.
(nit)
Suggested change
| fs.DurationVar(&kubeletSyncPeriod, "kubelet-sync-period", 3*time.Minute, "Sync period duration for updating kubelet endpoints (e.g., 10s, 2m, 1h30m).") | |
| fs.DurationVar(&kubeletSyncPeriod, "kubelet-sync-period", 3*time.Minute, "How often the operator reconciles the kubelet Endpoints and EndpointSlice objects (e.g., 10s, 2m, 1h30m).") |
miinsun
pushed a commit
to miinsun/prometheus-operator
that referenced
this pull request
Aug 15, 2025
…rometheus-operator#7762) * feat: add configurable sync period for kubelet endpoints controller Add --kubelet-sync-period flag to allow customization of how often the kubelet endpoints controller syncs with the Kubernetes API. Default remains 3 minutes to maintain backward compatibility. --------- Co-authored-by: Donghee Jeong <danny253@naver.com> Co-authored-by: 정동희 <danny253@neowiz.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add
--kubelet-sync-periodflag to allow customization of how often the kubelet endpoints controller syncs with the Kubernetes API. Default remains 3 minutes to maintain backward compatibility.The hardcoded 3-minute sync period can cause timing issues in environments with
regular node scaling - when nodes are scaled down every 3 minutes, the sync timing can align in a way that causes Prometheus targets to remain persistently unhealthy, triggering false alarms.
Related Issue: N/A
Type of change
CHANGE(fix or feature that would cause existing functionality to not work as expected)FEATURE(non-breaking change which adds functionality)BUGFIX(non-breaking change which fixes an issue)ENHANCEMENT(non-breaking change which improves existing functionality)NONE(if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)Verification
Please check the Prometheus-Operator testing guidelines for recommendations about automated tests.
Changelog entry