Skip to content

Add apiserver-monitor problem daemon - #1387

Merged
kubernetes-prow[bot] merged 1 commit into
kubernetes:masterfrom
bjencks:npdmon
Nov 10, 2026
Merged

kubernetes-prow[bot] merged 1 commit into
kubernetes:masterfrom
bjencks:npdmon

Conversation

@bjencks

@bjencks bjencks commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Add a new built-in problem daemon plugin (apiserver-monitor) that checks connectivity to the Kubernetes API server.

It specifically creates a new client on every poll in order to test the full stack from TCP connection up.

This required moving kube_rest.Config creation from problemclient into pkg/util (util.NewKubeClientConfig) and initializing util.GlobalKubeClientConfig in npdMain for both problemclient and apiserver-monitor to consume.

@kubernetes-prow kubernetes-prow Bot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 26, 2026
@kubernetes-prow kubernetes-prow Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 26, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

Hi @bjencks. 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.

Details

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.

@kubernetes-prow kubernetes-prow Bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 26, 2026
@wangzhen127

Copy link
Copy Markdown
Member

/ok-to-test

@kubernetes-prow kubernetes-prow Bot 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 Oct 27, 2026
@bjencks
bjencks force-pushed the npdmon branch 4 times, most recently from 2711d59 to 24432ed Compare October 27, 2026 21:51

@wangzhen127 wangzhen127 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you add e2e coverage? The unit tests only cover inClusterConfig=false over plain/insecure HTTP, so the real in-cluster path (CA + SA token + protobuf Accept against the real /version) never runs. Cheapest options: (a) a kustomize patch in test/e2e/manifests/ that adds --config.apiserver-monitor=/config/apiserver-monitor.json for the GCE cluster jobs — a smoke test of the in-cluster path on a real API server (DaemonSet stays Ready, problem_counter{reason="APIServerUnreachable"} stays 0); (b) in test/e2e/metriconly, a context that starts NPD with --apiserver-override=http://127.0.0.1:1?inClusterConfig=false and a short-interval config and asserts problem_gauge{type="APIServerUnreachable",reason="APIServerUnreachable"} == 1. Both work in metricsOnly mode since they check metrics; either needs its own short-interval config, which is another reason to settle the defaults.

Comment thread config/apiserver-monitor.json Resolved
Comment thread README.md Resolved
@linux-foundation-easycla

linux-foundation-easycla Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: bjencks / name: Ben Jencks (b73be69)

@kubernetes-prow kubernetes-prow Bot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. and removed cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 2, 2026
@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Nov 2, 2026
Add a new built-in problem daemon plugin (apiserver-monitor) that checks
connectivity to the Kubernetes API server.

It specifically creates a new client on every poll in order to test the
full stack from TCP connection up.

This required moving kube_rest.Config creation from problemclient into
pkg/util (util.NewKubeClientConfig) and initializing
util.GlobalKubeClientConfig in npdMain for both problemclient and
apiserver-monitor to consume.
@wangzhen127

Copy link
Copy Markdown
Member

/lgtm
/hold

Feel free to unhold to merge when you are ready.

@kubernetes-prow kubernetes-prow Bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Nov 10, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bjencks, wangzhen127

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

The pull request process is described 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

@kubernetes-prow kubernetes-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 10, 2026
@bjencks

bjencks commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

/hold cancel

@kubernetes-prow kubernetes-prow Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 10, 2026
@kubernetes-prow
kubernetes-prow Bot merged commit 0370ee4 into kubernetes:master Nov 10, 2026
11 checks passed
@bjencks
bjencks deleted the npdmon branch November 12, 2026 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants