feat: run HTTP server standalone without Kubernetes - #1333
Open
tobiasgiese wants to merge 1 commit into
Open
Conversation
Extract /healthz, /conditions and /debug/pprof into a new httpexporter package so those endpoints are available when --enable-k8s-exporter=false. Previously the HTTP server was started only inside the k8s exporter, making it unavailable in non-Kubernetes environments. The new httpexporter tracks conditions in-memory via ExportProblems and starts on --port regardless of whether the Kubernetes API server is reachable. Signed-off-by: Tobias Giese <tgiese@nvidia.com>
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: tobiasgiese The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Member
Author
|
With a local built image I can see ❯ docker run --rm --name npd --privileged -v /dev/kmsg:/dev/kmsg:ro gcr.io/k8s-staging-npd/node-problem-detector:v1.37.0-alpha.1-31-g7bff5a4c-dirty \
--enable-k8s-exporter=false \
--prometheus-port=20257 \
--config.custom-plugin-monitor=config/custom-plugin-monitor.json
❯ docker exec -ti npd bash
root@5bcbcdda7f64:/# apt update -qq; apt install -qq -y curl jq &>/dev/null
2 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@5bcbcdda7f64:/# curl -s http://127.0.0.1:20256/conditions | jq
[
{
"type": "ReadonlyFilesystem",
"status": "False",
"transition": "2026-08-03T12:41:01.208945846Z",
"reason": "FilesystemIsNotReadOnly",
"message": "Filesystem is not read-only"
},
{
"type": "KernelDeadlock",
"status": "False",
"transition": "2026-08-03T12:41:01.208911429Z",
"reason": "KernelHasNoDeadlock",
"message": "kernel has no deadlock"
},
{
"type": "XfsShutdown",
"status": "False",
"transition": "2026-08-03T12:41:01.208911554Z",
"reason": "XfsHasNotShutDown",
"message": "XFS has not shutdown"
},
{
"type": "CperHardwareErrorFatal",
"status": "False",
"transition": "2026-08-03T12:41:01.208911596Z",
"reason": "CperHardwareHasNoFatalError",
"message": "UEFI CPER has no fatal error"
},
{
"type": "NTPProblem",
"status": "Unknown",
"transition": "2026-08-03T12:41:01.214200471Z",
"reason": "NTPIsUp",
"message": "Could not find 'systemctl' - require systemd"
}
] |
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.
fixes #1332
Extract /healthz, /conditions and /debug/pprof into a new httpexporter package so those endpoints are available when --enable-k8s-exporter=false. Previously the HTTP server was started only inside the k8s exporter, making it unavailable in non-Kubernetes environments. The new httpexporter tracks conditions in-memory via ExportProblems and starts on --port regardless of whether the Kubernetes API server is reachable.