$ account kubernetes-sigs
Kubebuilder is a CLI tool and library for scaffolding Kubernetes operator projects. It generates the complete project structure including Go controllers, webhooks, CRDs, RBAC, kustomize configurations, Helm charts, and CI/CD workflows. The tool implements a plugin architecture where built-in and external plugins handle specific scaffolding phases: project initialization, API/resource creation, webhook scaffolding, and configuration editing. The core scaffolding engine (pkg/machinery) uses templates with marker-based code injection and a filesystem abstraction to produce idempotent output. In production, a user runs `kubebuilder init` to bootstrap a project, then `kubebuilder create api` to add a custom resource and controller, and optionally `kubebuilder create webhook` for admission webhooks. The system relies on controller-runtime, controller-tools, kustomize, and the Go toolchain. The primary data flow is user input → CLI command → plugin chain → template rendering → file generation on disk. The PROJECT file (YAML) acts as the persistent configuration, tracked and versioned across scaffolding steps. The codebase demonstrates strong software engineering practices: clean separation of concerns with plugin interfaces, a generic scaffolding engine, comprehensive unit and end-to-end tests, and well-structured internal APIs. It is actively maintained with recent commits and a clear versioning strategy, though some alpha features (helm/v2alpha, alpha update) carry experimental risk.
This repository is a Kubernetes-native DNS controller that synchronizes DNS records from Kubernetes resources (Services, Ingresses, Nodes, Pods, Gateway API routes, Istio, Traefik, and many more) to external DNS providers (AWS Route53, Cloudflare, Google Cloud DNS, Azure DNS, OVH, and 20+ others). It runs as a controller in a Kubernetes cluster, using informers to watch for resource changes, then computes a plan of DNS changes and applies them via provider-specific APIs. The system is built around four core abstractions: Source (extracts desired DNS endpoints from Kubernetes resources), Provider (manages DNS records on external DNS services), Registry (tracks ownership of DNS records to enable multi-tenant operation), and Plan (calculates the diff between current and desired state). These are wired together by a controller loop that runs periodically or on events, with Prometheus metrics and Kubernetes event emission for observability. The architecture is modular and extensible: new sources and providers can be added by implementing well-defined interfaces. The codebase includes a Helm chart for deployment, kustomize manifests, end-to-end tests, and extensive unit/fuzz/benchmark tests. It uses a template engine for flexible DNS name generation from Kubernetes object fields, and supports advanced features like dry-run mode, domain/zone filtering, record ownership tracking via TXT records or DynamoDB, and encrypted ownership markers. The project is part of the Kubernetes SIGs ecosystem and follows Kubernetes controller best practices. Key entry points include main.go (binary entry), controller/execute.go (controller initialization and loop), source/store.go (source factory), provider/factory/provider.go (provider factory), and registry/factory/registry.go (registry factory). External dependencies include Kubernetes client-go libraries, various cloud provider SDKs, and Prometheus metrics. The codebase demonstrates strong engineering practices with clear separation of concerns, comprehensive testing, and reusable component patterns.
Karpenter is a Kubernetes cluster autoscaler that provisions and manages compute capacity (nodes) for pods that cannot be scheduled. It operates as a controller-runtime-based operator, using Custom Resource Definitions (CRDs) like NodePool, NodeClaim, CapacityBuffer, and NodeOverlay to declaratively manage node lifecycle. The system continuously reconciles the desired state (unschedulable pods, disruption budgets, static replicas) with the actual cluster state, creating or deleting NodeClaims via a pluggable CloudProvider interface (with implementations for AWS, Azure, GCP, and a fake/KWOK provider for testing). Key entry points include the operator startup in `pkg/operator/operator.go`, the provisioning loop in `pkg/controllers/provisioning/provisioner.go`, and the disruption controller in `pkg/controllers/disruption/controller.go`. External dependencies are minimal: it requires a Kubernetes cluster with controller-runtime, Prometheus for metrics, and optional DRA (Dynamic Resource Allocation) support via a separate driver. The codebase is production-grade, with extensive unit and integration tests, performance benchmarks, and a well-defined event/metrics system.
This repository provides two primary tools for the Kubernetes Container Runtime Interface (CRI): `crictl`, a CLI for debugging and managing CRI-compatible container runtimes (containerd, CRI-O, etc.), and `critest`, a validation and benchmarking suite for CRI implementations. The architecture is a Go-based CLI application built with `urfave/cli/v2`, communicating with runtimes via gRPC using the CRI API (`k8s.io/cri-api`). Key entry points are `cmd/crictl/main.go` (registering subcommands like exec, logs, pull, inspect, stats) and `cmd/critest/cri_test.go` (running Ginkgo-based conformance and benchmark tests). Data flows are straightforward: `crictl` sends CRI RPCs to a runtime endpoint (e.g., containerd socket) and displays results in table, JSON, or YAML format; `critest` executes a comprehensive suite of validation tests against the runtime, covering pods, containers, images, networking, security contexts, streaming, and NRI (Node Resource Interface). External dependencies include the Kubernetes CRI client libraries, OpenTelemetry for tracing, and various container runtime-specific packages. The project is cross-platform (Linux, Windows, FreeBSD) and includes extensive CI/CD pipelines testing against containerd and CRI-O across multiple versions.