Flag --enable-k8s-exporter=false causes loss of /healthz, /conditions, and /debug/pprof endpoints
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 56/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- go
- 領域
- backend, observability
調査の方向性
startHTTPReporting() と k8sexporter.NewExporterOrDie() からのその呼び出しを追跡し、その後 --enable-k8s-exporter と --port がどのように処理されるかを調べます。診断用 HTTP サーバーを、提案されているスタンドアロンの exporter に分離し、メモリ内の ExportProblems 条件の追跡も含めます。--enable-k8s-exporter=false で、ポート 20256 上の /healthz、/conditions、/debug/pprof/ を確認し、Prometheus メトリクスが引き続き機能することを確認して検証します。
索引モデルが issue の本文から書いたものです。
説明
When running NPD outside of Kubernetes (e.g. on a bare host or in a VM without a cluster), passing --enable-k8s-exporter=false is required to avoid a panic at startup. However, this flag also silently removes the HTTP diagnostic server on --port (default 20256), losing access to /healthz, /conditions, and /debug/pprof/.
Root cause
startHTTPReporting(), the function that starts the /healthz, /conditions, and pprof handlers, is called exclusively inside k8sexporter.NewExporterOrDie().
When --enable-k8s-exporter=false, that function returns nil immediately and the HTTP server is never started, even though --port is set to a non-zero value.
Steps to reproduce
❯ docker run --rm --name npd --privileged -v /dev/kmsg:/dev/kmsg:ro registry.k8s.io/node-problem-detector/node-problem-detector:v1.36.0 \
--enable-k8s-exporter=false \
--prometheus-port=20257 \
--config.custom-plugin-monitor=config/custom-plugin-monitor.json
❯ docker exec -ti npd bash
# Prometheus metrics work:
$ curl -Is http://127.0.0.1:20257/metrics
HTTP/1.1 200 OK
Content-Type: text/plain; version=0.0.4; charset=utf-8; escaping=underscores
Date: Mon, 03 Aug 2026 12:06:56 GMT
Content-Length: 1255
# But the HTTP server is gone:
$ curl http://127.0.0.1:20256/healthz
curl: (7) Failed to connect to 127.0.0.1 port 20256 after 0 ms: Couldn\'t connect to server
$ curl http://127.0.0.1:20256/conditions
curl: (7) Failed to connect to 127.0.0.1 port 20256 after 0 ms: Couldn\'t connect to server
$ curl http://127.0.0.1:20256/debug/pprof/
curl: (7) Failed to connect to 127.0.0.1 port 20256 after 0 ms: Couldn\'t connect to server
$
Expected behavior
/healthz, /conditions, and /debug/pprof should be available on --port regardless of whether --enable-k8s-exporter is true or false.
The Prometheus metrics endpoint (problem_counter, problem_gauge, etc.) already works without Kubernetes because those metrics are written directly by the problem daemons via OpenCensus; the HTTP diagnostic server should behave the same way.
Fix
Move the HTTP server out of the K8s exporter into a standalone httpexporter that tracks conditions in-memory via ExportProblems and is started independently of --enable-k8s-exporter.
- 主要言語
- Go
- スター
- 3.5k
- フォーク
- 704
- 平均マージ
- 12時間 21分
- マージ済み PR(30日)
- 3
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
kubernetes/node-problem-detector のほかの issue
-
kind/cleanup sig/node
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
kubernetes/node-problem-detector#1331 ·
-
NPD needs significant unit test coverage再び着手できるかも @DigitalVeer が 65 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンkind/cleanup sig/node
kubernetes/node-problem-detector#1328 · コメント 2 件 · 担当者 1 名 ·
-
kind/bug
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
kubernetes/node-problem-detector#1176 · コメント 7 件 ·
-
kind/feature lifecycle/frozen
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
kubernetes/node-problem-detector#1112 · コメント 8 件 ·
-
Networking probesオープン
難易度 5/5 1週間以上 初心者へのやさしさ 32/100
kubernetes/node-problem-detector#991 · コメント 23 件 · リアクション 5 件 ·
kubernetes/node-problem-detector の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
NVIDIA/k8s-device-plugin#2076 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
agentic-workflows
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
area/release kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
kubernetes-sigs/kueue#16455 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信