Repolode
kubernetes-sigs

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. 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

#kubernetes#golang#operator#controller#k8s-api#cloud-native#k8s-sig-api-machinery

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