321 Commits
Author SHA1 Message Date
kubernetes-prow[bot]andGitHub aab5e5e2bb Merge pull request #1323 from hakman/precompile-log-buffer-regexps
Precompile log buffer regular expressions
2026-07-26 08:59:52 +00:00
kubernetes-prow[bot]andGitHub d98af639f0 Merge pull request #1306 from dpacgdm/fix/kube-proxy-livez-scale-down
healthchecker: use kube-proxy /livez to avoid scale-down false alerts
2026-07-25 06:59:49 +00:00
Ciprian Hacman b02e2dcd09 Precompile log buffer regular expressions
Compile fixed patterns during monitor and log counter initialization, pass compiled expressions to the log buffer, and reject invalid log counter patterns before watching logs.
2026-07-25 09:21:31 +03:00
Veer Singh c1d461ff76 Set the Node UID on recorded events
Recorded events refer to the node with an ObjectReference that has no
UID. The client already reads the Node object at startup to check that
kube-apiserver is ready, and this change stores the UID from that read.
The node status patch returns the Node object, so the client stores
that UID too.

This change removes the TODO in problem_client.go.
2026-07-23 22:43:23 -07:00
dpacgdm 87ad6dedbe healthchecker: clarify kube-proxy /livez comment
/livez still checks process and dataplane sync health; it only excludes
the node-eligibility check used by /healthz for scale-down draining.

Signed-off-by: dpacgdm <dpac.gdm@gmail.com>
2026-07-22 20:53:53 +05:30
kubernetes-prow[bot]andGitHub 4cc149d1ab Merge pull request #1318 from hakman/fix-config-json-trailing-commas
Fix invalid config JSON and enforce canonical config format
2026-07-22 09:03:45 +00:00
kubernetes-prow[bot]andGitHub 3b47d535b6 Merge pull request #1322 from DigitalVeer/logbuffer-regexp-cache
Cache compiled regular expressions in the log buffer
2026-07-22 06:05:44 +00:00
Ciprian Hacman 87dfadb120 Fix invalid config JSON and enforce canonical config format
config/disk-log-message-filelog.json contained trailing commas and no
trailing newline, so it could not be parsed by encoding/json and NPD
would fail to start when configured with it.

- Fix the invalid JSON
- Add TestShippedConfigs, which verifies that every shipped JSON config
  under config/ (top level and one directory down) parses (catching
  trailing commas, UTF-8 BOMs and other syntax errors) and is in the
  canonical format (2-space indent, trailing newline), showing a diff on
  failure
- Add `make fmt-configs` to rewrite nonconforming files in place
  (UPDATE_EXPECTED=y)
- Normalize the existing config files to the canonical format
  (whitespace-only changes)
2026-07-22 07:58:20 +03:00
Veer Singh bc34f45c3a Fix lint findings in the new tests
Return a snapshot struct from the test execution recorder.
Move the apply-configuration test table into a helper function.
2026-07-20 23:58:14 -07:00
Veer Singh be4034f35a Cache compiled regular expressions in the log buffer
This change keeps each compiled regular expression in a cache in the
log buffer. The cache size is not more than the number of patterns
given to Match.

This change removes the TODO in log_buffer.go.
2026-07-20 16:12:36 -07:00
Veer Singh 25105fd576 Add per-rule custom plugin intervals
Group rules by their effective invoke interval.
Use the global interval when a rule omits its interval.
Reject non-positive invoke intervals before scheduler startup.
Test grouped cadence, concurrency, and shutdown behavior.
2026-07-20 13:55:00 -07:00
Ciprian Hacman a20306e6a1 fix(logwatchers/kmsg): don't close the old parser twice when Stop() interrupts a restart
The restart path closes the failed parser before retrying. If stopping
is signaled during the retry wait, watchLoop's deferred cleanup closed
the same parser again, logging a spurious 'file already closed' error
at shutdown. Clear the reference after closing and nil-check the defer.
2026-07-11 10:28:27 +03:00
Ciprian Hacman b77c1eb03f fix(logwatchers/kmsg): don't block Stop() when the log channel is full
The log monitor stops draining logCh before calling watcher.Stop(), so
with a full channel (e.g. a kmsg burst at shutdown) watchLoop blocked
on the send forever, never called tomb.Done(), and Stop() hung.
Select on tomb.Stopping() alongside the send.
2026-07-11 10:27:59 +03:00
Ciprian Hacman 187d4d30d6 fix(logwatchers/kmsg): rate-limit parser restarts to prevent hot loop
If the restarted parser's channel closes again right away (reads keep
failing on the reopened /dev/kmsg), the watcher restarts in a tight
loop with no delay, spinning a CPU core and flooding the logs
(measured 37k restarts in 200ms). Delay the first attempt when the
previous restart was less than retryDelay ago.
2026-07-11 10:27:37 +03:00
dpacgdm 288a3ed68d healthchecker: use kube-proxy /livez to avoid scale-down false alerts
Cluster Autoscaler marks nodes with ToBeDeletedByClusterAutoscaler during
scale-down. kube-proxy /healthz intentionally fails in that case for LB
connection draining (KEP-3836), which made NPD report kube-proxy as
unhealthy. Switch the kube-proxy probe to /livez, which reflects process
health only.

Signed-off-by: dpacgdm <dpac.gdm@gmail.com>
2026-07-09 14:28:37 +05:30
Ciprian Hacman 3d516d9213 test(logwatchers/kmsg): inject parser factory for testability and cover restart/stop 2026-04-11 08:37:32 +03:00
Kubernetes Prow RobotandGitHub ea22add87e Merge pull request #1259 from hakman/kmsg-duplicate-message
fix(logwatchers/kmsg): prevent duplicate message replay after restart
2026-04-11 00:18:18 +05:30
Ciprian Hacman b3379b0d23 fix(logwatchers/kmsg): prevent duplicate message replay after restart 2026-04-10 16:06:32 +03:00
Ciprian Hacman 78f76b2778 fix(logwatchers/kmsg): don't close parser from Stop()
Closing the parser in Stop() triggers kmsgparser's read goroutine to
close its output channel, which made watchLoop take the restart path
(added in #1192) during intentional shutdown. Leave parser cleanup to
watchLoop's defer, which is the single owner of the parser lifecycle.
2026-04-10 15:45:22 +03:00
Arjun Raman 748fecd95d Remove opt-in knob for restarting kmsg parser and simplify retry loop 2026-03-24 11:20:14 -07:00
Arjun RamanandGitHub c530d1f701 Remove log message for restart on error
Removed log message for disabled restart on error.
2025-12-18 12:29:26 -08:00
Arjun Raman f1bdf8d30e Restart kmsg on error 2025-12-11 15:51:24 -08:00
Kubernetes Prow RobotandGitHub c0cfee4920 Merge pull request #1177 from hakman/depup
CodeQL / Analyze (go) (push) Failing after 1m28s
Scorecard supply-chain security / Scorecard analysis (push) Failing after 54s
Update dependencies and bump Go to v1.24.10
2025-12-02 03:46:24 -08:00
Ciprian Hacman 6b19393e1c Update dependencies and bump Go to v1.24.10 2025-11-29 11:15:51 +02:00
Ciprian Hacman 2e69489cc6 Update golangci-lint to v2.6.2 2025-11-29 10:42:18 +02:00
novahe 8844692098 Remove the invalid node.UID 2025-10-23 23:10:34 +08:00
Sergey Kanzhelev ad9436c5c9 fix linter issues 2025-10-22 22:36:03 +00:00
marinoborgesandGitHub 6d71278653 Fix newFakeProblemClient call 2025-10-13 16:36:03 -03:00
marinoborgesandGitHub 0de0e3bc53 Set APIVersion:v1 for node events 2025-10-09 00:42:49 -03:00
Sergey Kanzhelev 3e64800668 enabled a few more linter rules 2025-09-11 18:47:20 +00:00
Sergey Kanzhelev 0ce333bbc5 enabled and fixed the errcheck linter rule 2025-09-10 21:45:46 +00:00
Sergey Kanzhelev a3a4504706 fix the static ckeck linter issues 2025-09-08 19:10:28 +00:00
Sergey Kanzhelev db7eb8366c updated gopsutil 2025-08-13 21:53:17 +00:00
Sergey Kanzhelev 75bf501888 format imports 2025-08-13 16:56:32 +00:00
Kubernetes Prow RobotandGitHub 414d24893b Merge pull request #1088 from SergeyKanzhelev/linter
enable linter on repository
2025-08-13 09:41:07 -07:00
Sergey Kanzhelev a4118329f6 enable linter on repository 2025-08-13 16:12:41 +00:00
Johanan Liebermann cadd475940 Add support for Flatcar Container Linux
Signed-off-by: Johanan Liebermann <jliebermann@microsoft.com>
2025-08-11 19:03:38 +03:00
Marek Chodor a765aaecf7 feat!: Set default host address value to localhost.
Usage of `localhost` is family agnostic and will work regardless if
cluster is IPv4 or IPv6. The current value of `127.0.0.1` only works
for IPv4 clusters.

BREAKING CHANGE: It may break in rare cases where `localhost` does not
resolve as `127.0.0.1` (if OS config does not follow RFC5735 and
RFC6761).
2025-06-06 10:30:26 +00:00
Kubernetes Prow RobotandGitHub 01e1cf033e Merge pull request #1021 from nickbp/master
CodeQL / Analyze (go) (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
feat(k8sExporter): Options to allow disabling Events or Node Conditions
2025-03-10 23:57:48 -07:00
Chris Henzie 72f3041d2b Move disk and memory metrics in custom group to compute 2025-02-13 15:29:09 -08:00
Nick Parker 8d237a6c7c feat(k8sExporter): Options to allow disabling Events or Node Conditions
Both outputs are currently hardcoded to being enabled, this allows disabling one or the other. Defaults to both enabled to retain current behavior.

Larger clusters can save some etcd I/O by skipping one of these outputs if they aren't being consumed. In our case we aren't consuming the Events so writing them just creates more churn.
2025-02-04 14:53:19 +13:00
googs1025 cf0870fa12 chore: refactor custom plugin monitor method 2024-12-27 09:24:47 +08:00
googs1025 f5433f460d feature: add custom message for systemlogmonitor rule 2024-12-23 19:45:29 +08:00
googs1025 0d756b78fc chore: qps flag: use float32 instead of float64 2024-11-06 13:09:20 +08:00
googs1025 17dcc94418 feature: add QPS Burst flags 2024-10-27 21:58:45 +08:00
tashen 3a386a659e add skip list to aviod take too much efforts to translate in file log watcher 2024-10-16 10:56:15 +08:00
Ciprian Hacman 69da591e38 chore: Remove unused binary nethealth 2024-05-18 09:52:39 +03:00
Sudheer Nedlumane 7ee2a4dcda Add rocky linux support to GetOSVersion 2024-05-15 16:48:25 -07:00
Zhen Wang aed88103f1 Add comment to health checker repair function to explain the need of kill instead of restart 2024-04-05 16:56:03 +00:00
Henry Beberman fda3234b64 Add support for CBL-Mariner and Azure Linux 2024-03-28 18:34:00 +00:00