Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

dongheeJeong
Copy link
Contributor

Description

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.

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

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.
@dongheeJeong dongheeJeong requested a review from a team as a code owner August 1, 2025 07:27
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).")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(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).")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed.

Copy link
Contributor

@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@simonpasquier simonpasquier merged commit 40f4ebf into prometheus-operator:main Aug 4, 2025
23 checks passed
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 <[email protected]>
Co-authored-by: 정동희 <[email protected]>
@dongheeJeong dongheeJeong deleted the kec-sync-period branch August 21, 2025 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants