[kube-state-metrics] Fix autosharding configuration service - #7176
Open
Alja9 wants to merge 7 commits into
Open
Conversation
Signed-off-by: aldi.j <aldi.jayadi222@gmail.com>
Signed-off-by: aldi.j <aldi.jayadi222@gmail.com> Co-authored-by: GitHub Copilot <copilot@github.com>
Signed-off-by: aldi.j <aldi.jayadi222@gmail.com>
Signed-off-by: Aldi Jayadi <34116297+Alja9@users.noreply.github.com>
Signed-off-by: Aldi Jayadi <34116297+Alja9@users.noreply.github.com>
Alja9
requested review from
dotdc,
mrueg,
sebastiangaiser and
tariq1890
as code owners
August 9, 2026 14:38
Signed-off-by: Aldi Jayadi <34116297+Alja9@users.noreply.github.com>
Signed-off-by: Aldi Jayadi <34116297+Alja9@users.noreply.github.com>
sebastiangaiser
requested changes
Aug 11, 2026
sebastiangaiser
left a comment
Member
There was a problem hiding this comment.
Nice fix, this resolves the invalid Service manifest you get with autosharding plus a NodePort/LoadBalancer service.type (headless + NodePort can't coexist), and it also corrects the metrics-port nodePort guard that was checking service.nodePort instead of selfMonitor.telemetryNodePort. A few small things:
- Two of the unit tests are named "fails when autosharding enabled with NodePort/LoadBalancer service type", but they don't fail, they assert the service is forced to headless ClusterIP. Could you please rename them to match (e.g. "forces headless ClusterIP even when service.type is NodePort")?
- The test file is missing a trailing newline.
- Needs a rebase on main (currently conflicting) and a re-bump to 8.3.1.
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.
What this PR does / why we need it
Enforce
ClusterIPfor autosharding, avoid headless service error.Which issue this PR fixes
Autosharding get a Kubernetes error, example:
Instead of giving an error, how about to enforce it to the
ClusterIP(auto-corrected, no Kubernetes error).(optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close that issue when PR gets merged)Special notes for your reviewer
Checklist
[prometheus-couchdb-exporter])