From efe02543c00ce84cf5fb34bf747eee9461ec8942 Mon Sep 17 00:00:00 2001 From: Jeremy Edwards <1312331+jeremyje@users.noreply.github.com> Date: Tue, 9 Feb 2021 14:16:40 -0800 Subject: [PATCH] Add instructions for developing NPD on Windows Signed-off-by: Jeremy Edwards <1312331+jeremyje@users.noreply.github.com> --- README.md | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a8e51fbd1..d3709fd15 100644 --- a/README.md +++ b/README.md @@ -200,6 +200,37 @@ node-problem-detector --apiserver-override=http://APISERVER_IP:APISERVER_INSECUR For more scenarios, see [here](https://github.com/kubernetes/heapster/blob/master/docs/source-configuration.md#kubernetes) +## Windows + +Node Problem Detector has preliminary support Windows. Most of the functionality has not been tested but filelog plugin works. + +Follow [Issue #461](https://github.com/kubernetes/node-problem-detector/issues/461) for development status of Windows support. + +### Development + +To develop NPD on Windows you'll need to setup your Windows machine for Go development. Install the following tools: + +* [Git for Windows](https://git-scm.com/) +* [Go](https://golang.org/) +* [Visual Studio Code](https://code.visualstudio.com/) +* [Make](http://gnuwin32.sourceforge.net/packages/make.htm) +* [mingw-64 WinBuilds](http://mingw-w64.org/doku.php/download/win-builds) + * Tested with x86-64 Windows Native mode. + * Add the `$InstallDir\bin` to [Windows `PATH` variable](https://answers.microsoft.com/en-us/windows/forum/windows_10-other_settings-winpc/adding-path-variable/97300613-20cb-4d85-8d0e-cc9d3549ba23). + +```powershell +# Run these commands in the node-problem-detector directory. + +# Build +make clean windows-binaries + +# Test +make test + +# Run with containerd log monitoring enabled. (Assumes containerd is installed.) +%CD%\bin\windows_amd64\node-problem-detector.exe --logtostderr --enable-k8s-exporter=false --config.system-log-monitor=%CD%\config\windows-containerd-monitor-filelog.json +``` + ## Try It Out You can try node-problem-detector in a running cluster by injecting messages to the logs that node-problem-detector is watching. For example, Let's assume node-problem-detector is using [KernelMonitor](https://github.com/kubernetes/node-problem-detector/blob/master/config/kernel-monitor.json). On your workstation, run ```kubectl get events -w```. On the node, run ```sudo sh -c "echo 'kernel: BUG: unable to handle kernel NULL pointer dereference at TESTING' >> /dev/kmsg"```. Then you should see the ```KernelOops``` event. @@ -284,4 +315,4 @@ See [NPD e2e test documentation](https://github.com/kubernetes/node-problem-dete * [Slides](https://docs.google.com/presentation/d/1bkJibjwWXy8YnB5fna6p-Ltiy-N5p01zUsA22wCNkXA/edit?usp=sharing) * [Plugin Interface Proposal](https://docs.google.com/document/d/1jK_5YloSYtboj-DtfjmYKxfNnUxCAvohLnsH5aGCAYQ/edit#) * [Addon Manifest](https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/node-problem-detector) -* [Metrics Mode Proposal](https://docs.google.com/document/d/1SeaUz6kBavI283Dq8GBpoEUDrHA2a795xtw0OvjM568/edit) +* [Metrics Mode Proposal](https://docs.google.com/document/d/1SeaUz6kBavI283Dq8GBpoEUDrHA2a795xtw0OvjM568/edit) \ No newline at end of file