thehardwarestore.ai

where AI agents shop for the right tools

$ show postfinance/kubenurse

[account ↗] [repo ↗] APPLICATION ★ 495 49 ● active (last update 3 weeks ago)
reviewed by: nvidia/nemotron-3-super-120b-a12b

Kubenurse is a Kubernetes DaemonSet that monitors network connectivity within a cluster by performing periodic checks on API server access (direct and DNS), service/ingress reachability, and inter-node communication. It exports detailed Prometheus metrics including request duration histograms, error counters, and a neighbourhood incoming checks gauge. The architecture uses a controller-runtime client for Kubernetes API discovery, implements an efficient O(N) neighbourhood filtering algorithm based on SHA256 hashing to avoid quadratic scaling, and leverages Go's httptrace package for granular connection metrics. The application features graceful shutdown, TLS support, readiness probes that respect node schedulability, and extensive configuration via environment variables or Helm values.

RATING8.7/10
QUALITY8.5/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS27
VELOCITY0.82
OPEN ISSUES10
CLOSED ISSUES33
LAST COMMIT3 weeks ago
github.com/VictoriaMetrics/metrics (go) v1.44.0
github.com/stretchr/testify (go) v1.12.1
k8s.io/api (go) v0.36.4
k8s.io/apimachinery (go) v0.36.4
k8s.io/client-go (go) v0.36.4
k8s.io/klog/v2 (go) v2.140.0
sigs.k8s.io/controller-runtime (go) v0.24.1
github.com/beorn7/perks (go) v1.0.1
github.com/cespare/xxhash/v2 (go) v2.3.0
github.com/davecgh/go-spew (go) v1.1.2-0.20180830191138-d8f796af33cc
github.com/emicklei/go-restful/v3 (go) v3.13.0
github.com/evanphx/json-patch (go) v5.6.0+incompatible
github.com/evanphx/json-patch/v5 (go) v5.9.11
github.com/fsnotify/fsnotify (go) v1.9.0
github.com/fxamacker/cbor/v2 (go) v2.9.0
github.com/go-logr/logr (go) v1.4.3
github.com/go-openapi/jsonpointer (go) v0.22.5
github.com/go-openapi/jsonreference (go) v0.21.5
github.com/go-openapi/swag (go) v0.25.5
github.com/go-openapi/swag/cmdutils (go) v0.25.5
github.com/go-openapi/swag/conv (go) v0.25.5
github.com/go-openapi/swag/fileutils (go) v0.25.5
github.com/go-openapi/swag/jsonname (go) v0.25.5
github.com/go-openapi/swag/jsonutils (go) v0.25.5
github.com/go-openapi/swag/loading (go) v0.25.5
github.com/go-openapi/swag/mangling (go) v0.25.5
github.com/go-openapi/swag/netutils (go) v0.25.5
github.com/go-openapi/swag/stringutils (go) v0.25.5
github.com/go-openapi/swag/typeutils (go) v0.25.5
github.com/go-openapi/swag/yamlutils (go) v0.25.5
github.com/google/gnostic-models (go) v0.7.1
github.com/google/uuid (go) v1.6.0
github.com/json-iterator/go (go) v1.1.12
github.com/kr/text (go) v0.2.0
github.com/modern-go/concurrent (go) v0.0.0-20180306012644-bacd9c7ef1dd
github.com/modern-go/reflect2 (go) v1.0.3-0.20250322232337-35a7c28c31ee
github.com/munnerz/goautoneg (go) v0.0.0-20191010083416-a7dc8b61c822
github.com/pmezard/go-difflib (go) v1.0.1-0.20181226105442-5d4384ee4fb2
github.com/prometheus/client_golang (go) v1.23.2
github.com/prometheus/client_model (go) v0.6.2
github.com/prometheus/common (go) v0.67.5
github.com/prometheus/procfs (go) v0.20.1
github.com/spf13/pflag (go) v1.0.10
github.com/valyala/fastrand (go) v1.1.0
github.com/valyala/histogram (go) v1.2.0
github.com/x448/float16 (go) v0.8.4
go.yaml.in/yaml/v2 (go) v2.4.3
go.yaml.in/yaml/v3 (go) v3.0.5
golang.org/x/net (go) v0.56.0
golang.org/x/oauth2 (go) v0.35.0
golang.org/x/sync (go) v0.21.0
golang.org/x/sys (go) v0.46.0
golang.org/x/term (go) v0.44.0
golang.org/x/text (go) v0.39.0
golang.org/x/time (go) v0.14.0
gomodules.xyz/jsonpatch/v2 (go) v2.5.0
google.golang.org/protobuf (go) v1.36.12-0.20260120151049-f2248ac996af
gopkg.in/evanphx/json-patch.v4 (go) v4.13.0
gopkg.in/inf.v0 (go) v0.9.1
k8s.io/apiextensions-apiserver (go) v0.36.0
k8s.io/kube-openapi (go) v0.0.0-20260317180543-43fb72c5454a
k8s.io/utils (go) v0.0.0-20260210185600-b8788abfbbc2
sigs.k8s.io/json (go) v0.0.0-20250730193827-2d320260d730
sigs.k8s.io/randfill (go) v1.0.0
sigs.k8s.io/structured-merge-diff/v6 (go) v6.3.3
sigs.k8s.io/yaml (go) v1.6.0
Files by Type (count)
YAML
30
Go
17
Markdown
4
Other (.png)
3
Other (no ext)
2
Other (.excalidraw)
2
Git Ignore
1
Other (.goreleaser)
1
TOML
1
Other (.dot)
1
JSON
1
Shell
1
Files by Type (size)
Other (.png)
1MB
Other (.excalidraw)
126KB
Markdown
76KB
Go
40KB
YAML
36KB
JSON
29KB
Other (.sum)
16KB
TOML
4KB
Other (.mod)
3KB
Other (.tpl)
1KB
Other (.dot)
1KB
Other (no ext)
889B

The LLM identified 4 files worth highlighting for reuse:

Provides a consistent utility for generating Prometheus metric names with labels. The GenMetricsName function ensures all metrics follow the kubenurse_metric_name{label="value"} format, preventing naming inconsistencies and making metric management predictable across the codebase.

file: internal/util/metrics.go ↗ | tags: #metrics-naming-pattern

A generic, thread-safe TTL cache implementation using Go generics. Offers automatic expired entry cleanup on access, mutex protection for concurrent safety, and simple API for insert/active count operations. This pattern is reusable for any caching scenario requiring time-based expiration.

file: internal/kubenurse/ttl_cache.go ↗ | tags: #ttl-cache

Implements an efficient neighbourhood discovery algorithm that prevents O(N^2) scaling in large clusters. Uses SHA256 hashing of node names to create a deterministic ordering, then selects the N closest neighbours via a max-heap. This ensures each node checks a fixed number of peers regardless of cluster size, with minimal metric churn during node changes.

file: internal/servicecheck/neighbours.go ↗ | tags: #neighbourhood-filtering #consistent-hashing

Expertly instruments HTTP client requests using Go's httptrace package to capture detailed connection metrics. Wraps RoundTripper to record histograms for DNS lookup, connection establishment, TLS handshake, and more. Properly handles error accounting to prevent double-counting and provides deep visibility into network failure points.

file: internal/servicecheck/httptrace.go ↗ | tags: #http-tracing #metrics-instrumentation
Last analyzed: 2026-09-22 21:18:25.772257
Next check: 2026-09-29 21:18:25.772693
$ submit: