# kubernetes-sigs/controller-runtime

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/kubernetes-sigs-controller-runtime).**

2,917 stars · 1,283 forks · Go · Apache-2.0

## Links

- GitHub: https://github.com/kubernetes-sigs/controller-runtime
- awesome-repositories: https://awesome-repositories.com/repository/kubernetes-sigs-controller-runtime.md

## Topics

`k8s-sig-api-machinery`

## Description

This project provides a framework for building Kubernetes operators and custom controllers. It offers a set of libraries designed to manage the lifecycle of cluster resources, enabling developers to synchronize the actual state of a cluster with a desired configuration through event-driven reconciliation loops.

The framework distinguishes itself by providing a manager-orchestrated environment that coordinates multiple controllers and webhooks within a single process. It includes built-in support for optimistic concurrency control to prevent update conflicts and utilizes in-memory informer caching to maintain a synchronized local view of cluster state, which reduces load on the API server.

Beyond core reconciliation, the project includes tools for schema-based resource mapping, allowing for the registration of custom resource definitions. It also provides mechanisms for admission control, enabling the validation and mutation of resource requests to enforce compliance before data is persisted. The framework includes a dedicated testing suite that spins up ephemeral, isolated API server environments to validate controller logic against real cluster behavior.

## Tags

### DevOps & Infrastructure

- [Kubernetes Controllers](https://awesome-repositories.com/f/devops-infrastructure/kubernetes-controllers.md) — Implements a framework for building custom controllers that synchronize cluster state through declarative reconciliation loops.
- [Kubernetes Operators](https://awesome-repositories.com/f/devops-infrastructure/kubernetes-operators.md) — Provides a framework for building custom controllers that watch cluster resources and execute logic to maintain a desired state.
- [Cluster State Reconciliation](https://awesome-repositories.com/f/devops-infrastructure/cluster-state-reconciliation.md) — Synchronizes the state of cluster resources by watching for changes and executing custom logic to ensure the actual state matches the desired configuration. ([source](https://github.com/kubernetes-sigs/controller-runtime/blob/main/examples))
- [Admission Webhooks](https://awesome-repositories.com/f/devops-infrastructure/admission-webhooks.md) — Intercepts resource creation and update requests to validate or mutate data before persistence to cluster storage.
- [Custom Resource Definitions](https://awesome-repositories.com/f/devops-infrastructure/custom-resource-definitions.md) — Maps data structures to specific API group-version-kinds to allow the system to recognize and manage custom resource definitions. ([source](https://github.com/kubernetes-sigs/controller-runtime/blob/main/FAQ.md))
- [Kubernetes API Clients](https://awesome-repositories.com/f/devops-infrastructure/kubernetes-api-clients.md) — Provides a comprehensive library for interacting with the Kubernetes API, managing resource schemas, and handling custom business logic.

### Data & Databases

- [Reconciliation Loops](https://awesome-repositories.com/f/data-databases/data-management/backup-recovery-utilities/data-recovery/manifest-based-state-reconciliation/reconciliation-loops.md) — Implements continuous control loops that converge cluster resources from their current state toward a desired target state.
- [Admission Controllers](https://awesome-repositories.com/f/data-databases/field-validation/kubernetes-resource-validation/admission-controllers.md) — Intercepts resource creation or update requests to enforce custom business rules or inject default values before changes are persisted. ([source](https://github.com/kubernetes-sigs/controller-runtime/tree/main/examples))
- [In-Memory Caches](https://awesome-repositories.com/f/data-databases/in-memory-caches.md) — Maintains a synchronized local copy of cluster state in memory to reduce API server load and accelerate reconciliation.
- [Optimistic Concurrency Control](https://awesome-repositories.com/f/data-databases/optimistic-concurrency-control.md) — Uses resource versioning and conditional updates to prevent conflicts when multiple processes modify the same cluster object.

### Development Tools & Productivity

- [Local Control Plane Testing](https://awesome-repositories.com/f/development-tools-productivity/debugging-profiling-testing/test-execution-management/automated-test-execution/local-control-plane-testing.md) — Spins up a local API server environment to validate controller logic against real cluster behavior during testing.

### Security & Cryptography

- [Admission Controllers](https://awesome-repositories.com/f/security-cryptography/infrastructure-policy-enforcers/virtual-cluster-resource-policies/admission-controllers.md) — The framework modifies incoming resource requests automatically by injecting or updating fields to ensure compliance with cluster-wide policies or defaults. ([source](https://github.com/kubernetes-sigs/controller-runtime/blob/main/examples))

### Networking & Communication

- [Eventual Consistency Orchestrators](https://awesome-repositories.com/f/networking-communication/eventual-consistency-orchestrators.md) — Handles potential cache staleness through optimistic locking, deterministic naming, or periodic requeueing to ensure eventual consistency. ([source](https://github.com/kubernetes-sigs/controller-runtime/blob/main/FAQ.md))

### Software Engineering & Architecture

- [Resource Mapping](https://awesome-repositories.com/f/software-engineering-architecture/annotation-based-metadata-mapping/schema-mappings/resource-mapping.md) — Associates Go data structures with specific API group-version-kinds to enable automated serialization and management of custom resources.
- [Controller Lifecycle Management](https://awesome-repositories.com/f/software-engineering-architecture/controller-lifecycle-management.md) — Orchestrates the startup, shared caching, and graceful shutdown of multiple controllers and webhooks within a single process.
- [State Reconciliation](https://awesome-repositories.com/f/software-engineering-architecture/state-reconciliation.md) — Maps multiple related objects to a single root object and enforces the desired state for that entire resource tree during each execution cycle. ([source](https://github.com/kubernetes-sigs/controller-runtime/blob/main/FAQ.md))

### Testing & Quality Assurance

- [API Testing Frameworks](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/api-protocol-testing/api-testing-frameworks.md) — Provides a testing suite that spins up a local API server to validate controller logic against real cluster behavior. ([source](https://github.com/kubernetes-sigs/controller-runtime/blob/main/FAQ.md))
- [Kubernetes](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/kubernetes.md) — Provides a dedicated testing suite that spins up ephemeral, isolated API server environments to validate controller logic against real cluster behavior.
