A Kubernetes controller and CRD for managing isolated, stateful, single-pod sandboxes, aimed at AI agent runtimes and RL workloads.
kubernetes-sigs/controller-runtime
A set of Go libraries for building Kubernetes controllers and operators, used as the foundation of Kubebuilder and Operator SDK.
- Stars
- 2,988
- Forks
- 1,332
- Open issues
- 69
- Last commit
- 3 days ago
What is it?
controller-runtime is a set of Go libraries for writing Kubernetes controllers. A controller watches cluster resources and works to bring their actual state in line with the desired state declared in the API. The library supplies the common plumbing for this pattern, including managers that run controllers, builders that wire up watches and reconcile loops, and a client for reading and writing objects.
The project is the shared runtime underneath Kubebuilder and Operator SDK, which are the usual entry points for scaffolding new operators. Developers who build their own controllers directly on Go typically import these packages rather than writing informer and work-queue code by hand. Versions are tied to Kubernetes minor releases, with a compatibility table mapping each controller-runtime release to a client-go version and minimum Go version.
Key features
- 01Manager for running and coordinating multiple controllers
- 02Builder API for declaring watches and reconcile logic
- 03Cached client for reading and writing Kubernetes objects
- 04Support for webhooks and leader election
- 05Compatibility table mapping releases to client-go and Go versions
Use cases
- Building a custom Kubernetes operator in Go
- Writing controllers that reconcile custom resource definitions
- Extending Kubebuilder-generated projects with additional controller logic
Quick start
- 1
Start with Kubebuilder or Operator SDK, which are built on this library (see Kubebuilder's Quick Start)
Things to know
- The project stays on a zero major version and allows breaking changes between minor versions.
- Each minor version targets a specific client-go version and minimum Go version, so you must match them to your Kubernetes dependencies.
In collections
Topics
FAQ
- What is controller-runtime?
- A set of Go libraries for building Kubernetes controllers and operators, used as the foundation of Kubebuilder and Operator SDK. controller-runtime is a set of Go libraries for writing Kubernetes controllers. A controller watches cluster resources and works to bring their actual state in line with the desired state declared in the API. The library supplies the common plumbing for this pattern, including managers that run controllers, builders that wire up watches and reconcile loops, and a client for reading and writing objects.
- Is controller-runtime free to use? What license does it have?
- controller-runtime is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is controller-runtime still maintained?
- Actively maintained. The last commit to controller-runtime was on Nov 5, 2026.
- What can I use controller-runtime for?
- Building a custom Kubernetes operator in Go Writing controllers that reconcile custom resource definitions Extending Kubebuilder-generated projects with additional controller logic
- How do I install controller-runtime?
- Start with Kubebuilder or Operator SDK, which are built on this library (see Kubebuilder's Quick Start)
- Where can I get controller-runtime?
- The source code and installation instructions are on GitHub: https://github.com/kubernetes-sigs/controller-runtime
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A Go SDK for building Kubernetes Operators, offering high-level APIs, scaffolding and code generation on top of controller-runtime.
Kubernetes operator that runs and autoscales self-hosted GitHub Actions runners as ephemeral containers.
A Kubernetes operator that deploys and manages Ray applications through RayCluster, RayJob and RayService resources.
A Kubernetes operator that deploys and manages K8sGPT, using an AI backend to diagnose cluster problems and optionally auto-remediate image pull failures.
A Kubernetes operator suite that automates deploying LLM inference, fine-tuning, and RAG services onto GPU nodes.