Skip to content

feat: run HTTP server standalone without Kubernetes - #1333

Open
tobiasgiese wants to merge 1 commit into
kubernetes:masterfrom
tobiasgiese:run-http-server-standalone
Open

feat: run HTTP server standalone without Kubernetes#1333
tobiasgiese wants to merge 1 commit into
kubernetes:masterfrom
tobiasgiese:run-http-server-standalone

Conversation

@tobiasgiese

Copy link
Copy Markdown
Member

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.

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>
@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 3, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

Details 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

@tobiasgiese

tobiasgiese commented Aug 3, 2026

Copy link
Copy Markdown
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"
  }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flag --enable-k8s-exporter=false causes loss of /healthz, /conditions, and /debug/pprof endpoints

1 participant