Stern is a Go CLI tool that tails multiple pods and containers on Kubernetes, with color-coded output, regex-based filtering, and customizable Go templates. It relies on the Kubernetes client-go library to watch pod events and stream logs from matching containers. The architecture is a single binary with a Cobra command tree, where the core logic in the `stern/` package handles target filtering (by pod name, container name, container state, condition), log line parsing (timestamp extraction, include/exclude/highlight regex), and template rendering. The code is well-structured, thoroughly tested, and follows modern Go patterns. It supports advanced features like interactive prompts, shell completion (bash/zsh/fish), config files, and various output formats. While most components are tightly integrated for this specific use case, several sub-packages (color management, condition matching, container state matching, log filtering utilities) are cleanly isolated and could be reused in other Kubernetes or CLI projects.
Kubenix is a Nix-based framework for declarative Kubernetes management. It uses the NixOS module system to define Kubernetes resources, Helm charts, Docker images, and custom resources in a type-safe, composable manner. The project provides a CLI tool for applying manifests with diffing, pruning, and secret injection via vals. At its core, kubenix is a set of Nix library functions and modules that evaluate user configuration to produce Kubernetes YAML/JSON. It supports submodules (nested composable configurations), testing frameworks (including kubetest), and code generation from Kubernetes OpenAPI specs. The architecture is purely functional, leveraging Nix's lazy evaluation to merge and validate resources at build time. This is a hybrid project combining a library (Nix modules and functions) with an application (CLI tool), but it is classified as an application because its primary deliverable is a deployable package and CLI.
Robusta KRR is a CLI tool for optimizing Kubernetes resource allocation by recommending CPU and memory requests/limits based on Prometheus metrics. It features a modular architecture with pluggable strategies for recommendation algorithms, multiple output formats, and integrations with various Prometheus-compatible systems. The project includes an enforcer component (mutating webhook) for automatic application of recommendations. The codebase demonstrates good engineering practices with clear separation of concerns, proper error handling, and extensible design patterns.
kr8s is a Python client library for the Kubernetes API that provides both synchronous and asynchronous interfaces, designed to be familiar to users of kubectl. The core implementation is async-first, with sync wrappers generated via an anyio-based bridging layer, ensuring a single source of truth for all logic. The library includes built-in classes for common Kubernetes resources (Pod, Service, Deployment, Node, Job, etc.), dynamic class creation for custom resources, and support for exec, port forwarding, watching, and client caching. Authentication is handled through kubeconfig files, service accounts, exec plugins, OIDC, and direct tokens, all abstracted behind a unified KubeAuth class. The architecture is modular: the main entry points are `kr8s` (sync) and `kr8s.asyncio` (async), with the heavy lifting in `kr8s/_api.py`, `kr8s/_objects.py`, and several utility modules. The library is extensively tested with pytest and Kind clusters, and includes a full featured CLI example (`kubectl-ng`) that reimplements kubectl commands using kr8s, rich, and typer. Documentation is comprehensive, covering installation, authentication, object operations, and guides for building operators. Quality is solid: clean separation of concerns, thoughtful caching (vendored asyncache), robust error handling, and a well-documented API. The primary weakness is the monolithic `_objects.py` (1000+ lines) and the manual sync/async wrapping, which can introduce maintenance overhead. Overall, kr8s is a professionally maintained, production-ready Kubernetes client that stands out for its simplicity and extensibility.
Kubewall is a production-grade, open-source Kubernetes dashboard that provides real-time multi-cluster management through a single-binary web application. It combines a Go backend (Echo framework, client-go informers) with a React/TypeScript frontend (Redux Toolkit, shadcn/ui, TanStack Router) to offer live monitoring, YAML editing, pod log streaming, port forwarding, and an AI-powered troubleshooting assistant (kwAI). The architecture relies on Server-Sent Events (SSE) to push Kubernetes resource updates to the browser, with an in-memory informer cache per cluster. The backend exposes REST endpoints for every standard Kubernetes resource type as well as Custom Resource Definitions (CRDs), while the frontend uses virtualized data tables, Radix UI primitives, and lazy-loaded Monaco editor for editing. The system supports multiple kubeconfig authentication methods and includes a Helm chart for deployment.
kubectl-foreach is a Go-based CLI tool designed to run kubectl commands against multiple Kubernetes contexts in parallel. It retrieves context lists from kubeconfig, applies user-defined filters (exact match, regex, exclusion) to select target contexts, executes the provided kubectl command concurrently for each context, and prefixes output lines with context names for clarity. The architecture is monolithic with clear separation of concerns: argument parsing, filtering, context matching, and parallel execution are isolated into distinct modules. Key dependencies include kubectl (for context retrieval and command execution) and third-party libraries for colored output (gchalk), testing (testify), and concurrency management (golang.org/x/sync).
kubectl-df-pv is a kubectl plugin that displays disk usage (like the Unix `df` command) for Kubernetes Persistent Volumes. It retrieves storage metrics from each node's kubelet stats/summary endpoint and presents them in a color-coded, human-readable table. The tool handles concurrent node queries using goroutines and channels, supports filtering by namespace, and allows users to select which columns to display (including inode information). It auto-converts byte sizes to IEC binary prefixes (Ki, Mi, Gi, Ti) and colorizes usage percentages (red > 75%, yellow < 25%, green otherwise). The codebase is a single Go binary using Cobra for CLI parsing, client-go for Kubernetes API interaction, and go-pretty for table rendering. It is a well-structured, focused utility that solves a specific operational need for Kubernetes administrators. While the core logic is solid, the project is relatively simple and does not exhibit exceptional architectural depth or highly reusable components beyond basic byte formatting.