Skip to content

adds a list of available HTTP endpoints for the kube-controller-manag… #133218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nmn3m
Copy link

@nmn3m nmn3m commented Jul 25, 2025

What type of PR is this?

/kind feature
/kind cleanup
/kind documentation

What this PR does / why we need it:

This PR enhances the /statusz page of the kube-controller-manager by including a list of all registered HTTP endpoints exposed by the component.
This provides better visibility into available health, metrics, and debug endpoints, which is particularly valuable for observability and operational tooling.
It aligns with the ongoing effort to improve introspection across Kubernetes control plane components.

Which issue(s) this PR is related to:

Fixes #133182
Part of umbrella issue: #132474

Special notes for your reviewer:

  • This mirrors similar efforts recently merged for kube-scheduler and kube-apiserver.
  • The endpoint list is sorted and clearly grouped to improve readability.
  • Only non-private handlers are shown to avoid leaking sensitive internals.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

Example Response:

kube-controller-manager statusz
Warning: This endpoint is not meant to be machine parseable, has no formatting compatibility guarantees and is for debugging purposes only.

Started  Thu Jul 31 22:23:19 UTC 2025
Up  0 hr 01 min 00 sec
Go version  go1.24.5
Binary version  1.34.0-beta.0.631+2a3faeb5c9ffbb
Emulation version  1.34
Paths   /configz /healthz /metrics

@k8s-ci-robot
Copy link
Contributor

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. kind/documentation Categorizes issue or PR as related to documentation. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jul 25, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @nmn3m. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 25, 2025
@nmn3m
Copy link
Author

nmn3m commented Jul 25, 2025

cc @richabanker

@helayoty
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 25, 2025
@ylink-lfs
Copy link
Contributor

/ok-to-test

Just a note that PR kube-controller-manager: list available endpoints in /statusz #133200 was opened earlier than this one. Assuming their content is not significantly different, we should handle them on a first-come, first-served basis.

@nmn3m
Copy link
Author

nmn3m commented Jul 27, 2025

/ok-to-test

Just a note that PR kube-controller-manager: list available endpoints in /statusz #133200 was opened earlier than this one. Assuming their content is not significantly different, we should handle them on a first-come, first-served basis.

@ylink-lfs if you took a look at the issue, you will find that @richabanker sent it to me first, as this issue was discussed in the weekly meeting. I was working on it.

kubeControllerManager,
statusz.NewRegistry(
c.ComponentGlobalsRegistry.EffectiveVersionFor(basecompatibility.DefaultKubeComponent),
statusz.WithListedPaths([]string{"/healthz", "/livez", "/metrics", "/readyz"}),
Copy link
Contributor

Choose a reason for hiding this comment

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

we dont want to hardcode the paths here, since the paths exposed can change with every release. I was wondering if we could something similar as what we are doing for apiserver here i.e. make use of the handler's ListedPaths() ?

@k8s-ci-robot k8s-ci-robot added the do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. label Jul 28, 2025
@nmn3m nmn3m force-pushed the kube-controller-manager-statuz branch from 17d117a to fa84d07 Compare July 28, 2025 19:41
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. label Jul 28, 2025
@nmn3m nmn3m requested a review from richabanker July 28, 2025 19:41
@nmn3m
Copy link
Author

nmn3m commented Jul 28, 2025

/retest

@BenTheElder
Copy link
Member

/triage accepted
/assign @richabanker

@k8s-ci-robot k8s-ci-robot added the triage/accepted Indicates an issue or PR is ready to be actively worked on. label Jul 29, 2025
@k8s-ci-robot k8s-ci-robot removed the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jul 29, 2025
@nmn3m nmn3m force-pushed the kube-controller-manager-statuz branch from fa84d07 to 2a3faeb Compare July 31, 2025 20:30
@richabanker
Copy link
Contributor

Can we also evolve this test to check for the newly added Paths section in the response and verify it has the expected paths? That would be a good way to detect, in future, if a new path becomes available, whether it makes sense to include it in /statusz's response payload.

@nmn3m nmn3m force-pushed the kube-controller-manager-statuz branch from 2a3faeb to 8f8b501 Compare August 1, 2025 00:43
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. area/test and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 1, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: nmn3m
Once this PR has been reviewed and has the lgtm label, please assign mikedanese for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the sig/testing Categorizes an issue or PR as relevant to SIG Testing. label Aug 1, 2025
@nmn3m
Copy link
Author

nmn3m commented Aug 1, 2025

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/documentation Categorizes issue or PR as related to documentation. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

List available endpoints for kube-controller-manager's /statusz
6 participants