Tutorial: Integrating Node Problem Detector
Tutorial: Integrating Node Problem Detector
This tutorial installs Kubernetes node-problem-detector (NPD), configures NVSentinel to watch selected NPD Node Conditions, and validates the integration.
By the end you will have:
- NPD running on each Linux node and monitoring kernel messages.
- Kubernetes Object Monitor (KOM) watching the opt-in
XfsShutdown,CperHardwareErrorFatal, andReadonlyFilesystemNPD conditions. - A safe procedure for validating NPD detection and KOM publication.
- A pattern for monitoring additional Node Conditions from a custom NPD configuration.
Who is this for? Cluster administrators who run NVSentinel and want to consume permanent Node Conditions produced by NPD.
Just want the AI to do it? Jump to Appendix: One-shot AI prompt.
Safety: The opt-in NPD policies recommend
REPLACE_VM. Validate them only in a non-production cluster or while downstream quarantine and remediation components are disabled. Inject test messages only on a disposable node with no running jobs.
Prerequisites
- Kubernetes 1.25 or later
- Helm 3 and
kubectl. - Cluster-admin access to install a privileged DaemonSet and patch Node status.
- Shell or SSH access to at least one disposable Linux node for end-to-end validation.
- An NVSentinel release that contains the NPD KOM policies.
See the NVSentinel Helm chart guide for the complete NVSentinel prerequisites.
1. Understand the integration
NPD detects a host problem and publishes a permanent condition in
Node.status.conditions. KOM watches the Node and publishes a fatal
NVSentinel HealthEvent when the condition type, status, and reason match a
configured policy.
This integration watches these condition and reason pairs:
These three policies are provided in a separate opt-in overlay because their conditions are enabled by default in the upstream NPD configuration and have approved NVSentinel actions. KOM is not limited to these conditions. If a custom NPD configuration publishes another permanent Node Condition, add a KOM policy for its condition type, status, and reason as shown in Configure a custom NPD Node Condition.
For the design rationale and limitations, see ADR-053.
2. Install NPD if not already present
The following instructions cover deploying NPD as a Kubernetes DaemonSet. If your cloud provider already runs NPD as a DaemonSet or host service, use the provider’s documentation for installation and upgrade instructions. Do not deploy a second copy because multiple NPD instances can compete to own the same Node Conditions.
Check for a Kubernetes installation:
If NPD is already installed, do not install another instance. Provider-supplied configurations can differ from upstream defaults, so confirm that the existing installation defines all three condition and reason pairs listed above.
If NPD is not installed, follow the upstream NPD installation guide for the installation method appropriate to your cluster. NVSentinel does not install, configure, or manage NPD.
Before continuing, confirm that the NPD installation:
- runs on every node that NVSentinel should monitor;
- loads the upstream
kernel-monitor.jsonandreadonly-monitor.jsondefinitions;
For a DaemonSet installation, use the namespace and DaemonSet name shown by the check above or selected during installation. Derive its pod selector, check that its desired and ready counts match, and list the nodes running its pods:
3. Configure NVSentinel and KOM policies
NPD policies are intentionally excluded from the default KOM values because NVSentinel does not install NPD or control how an operator handles its conditions. The repository provides an explicit NPD remediation overlay for clusters where NVSentinel should own these conditions.
Download or copy values-npd-remediation.yaml and use it as the values file.
It enables KOM, retains the default ReplaceNotReadyNode policy, and adds the three
supported NPD policies.
Configure a custom NPD Node Condition
NPD can publish additional permanent Node Conditions from custom monitor
configurations. Once NPD publishes a condition, add a matching policy to the
existing kubernetes-object-monitor.policies list in your copy of
values-npd-remediation.yaml.
For example, suppose a custom NPD monitor publishes:
Add this policy to the existing list:
For custom condition policies:
- Use a stable, unique policy name; it becomes the HealthEvent
checkName. - Match the exact condition type and reason emitted by the custom NPD monitor.
- Assign a unique error code and validate the policy in a non-production cluster before enabling downstream remediation.
- Have NPD set the same condition to
Falseonly after recovery is validated.
See KOM policy configuration for more CEL expression examples.
Install or upgrade NVSentinel
Use one command for both installation and upgrade. For an existing release,
--reuse-values preserves its current user-supplied values before applying the
NPD overlay. For a new release, Helm has no previous values to reuse and
installs from the chart defaults plus the overlay.
Verify KOM:
4. Validate the integration
Validate NPD and KOM end to end by injecting a synthetic kernel message. This publishes a synthetic fatal HealthEvent, so confirm that this is a non-production cluster or that downstream quarantine, drain, and remediation components are disabled.
The upstream NPD Try It Out guide documents injecting synthetic messages into the kernel message stream when testing rules. This does not damage the filesystem or hardware, but it creates real NPD conditions. Run only one test at a time.
Choose a disposable node:
SSH to $NODE and inject one of these messages:
From your workstation, inspect the resulting source conditions:
Confirm that KOM published each matched policy and platform-connector applied the resulting NVSentinel Node Condition:
Note: If the downstream remediation components are enabled, each matched fatal policy should also cause the affected node to be cordoned. Because these policies recommend
REPLACE_VM, fault-remediation should create aTerminateNoderemediation custom resource for the node.
SystemLogMonitor permanent conditions are latched. Injected messages remain
eligible during the default five-minute lookback, so wait at least five minutes
after the final injection before restarting NPD. Do not restart the DaemonSet:
that restarts NPD on every eligible node and resets all process-owned
conditions. Delete only the NPD pod scheduled on the tested node, then wait for
its replacement. Reuse NPD_NAMESPACE and NPD_SELECTOR from step 2:
A False condition after restart only shows that the NPD process reset its
state; it does not prove recovery from a real failure. Restarting NPD can also
cause KOM to observe a healthy transition and cancel active break-fix
processing, so limit this procedure to the test node after validation.
Troubleshooting
NPD does not publish the source condition
- Confirm
/dev/kmsgis mounted in the NPD pod. - Confirm the process loads
kernel-monitor.jsonandreadonly-monitor.json. - Confirm the injected message contains the
kernel:prefix and exactly matches the expected capitalization.
KOM does not publish a HealthEvent
- Confirm
global.kubernetesObjectMonitor.enabled: true. - Confirm the relevant policy has
enabled: true. - Compare the Node Condition type, status, and reason with the CEL predicate.
A source condition remains True
This is expected for permanent conditions produced by SystemLogMonitor.
Validate remediation, allow the monitor lookback window to expire, and then
restart NPD. Never use an NPD restart alone as proof that the host recovered.
Appendix: One-shot AI prompt
Paste this prompt into an AI coding agent with access to your NVSentinel checkout. Replace the bracketed values before running it.