Kubebuilder: scaffolding Kubernetes APIs from CRDs to controllers
Kubebuilder - SDK for building Kubernetes APIs using CRDs
At a glance
- What is it?
- Kubebuilder is a Go SDK that generates the project layout, CRD types and reconcile loop for a Kubernetes API. It suits teams writing operators in Go, and it assumes you already know your way around controllers.
- Who is it for?
- Adopt Kubebuilder if you are writing a Kubernetes operator in Go and want the canonical project layout, code generation and envtest harness rather than a hand-rolled controller. Do not adopt it if you need a non-Go operator, since that path runs through Operator-SDK's plugins, or if you need Windows support, which the README says is not planned.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 1 day ago.
- What is it written in?
- Mainly Go, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.
Editorial analysis
What Kubebuilder solves for operator authors
Writing a Kubernetes API by hand means writing a lot of the same files: the group, version and kind registration, the deepcopy functions, the CRD manifest, the manager wiring, the reconcile skeleton, the Dockerfile, the RBAC markers. The README states the motivation plainly, that building Kubernetes tools and APIs involves making a lot of decisions and writing a lot of boilerplate, and the framework exists to minimize that toil. Kubebuilder targets developers who are building APIs on top of custom resource definitions, controllers and admission webhooks, and who are doing it in Go. The README compares it to Ruby on Rails and SpringBoot, which is a fair description of the intent: you get a working skeleton fast, then you fill in the business logic. The scope is narrow on purpose. It is not a general controller library and it is not a deployment platform. It is the scaffolding and the code generators around controller-runtime and controller-tools, plus a plugin system that lets the scaffolding be extended. If your problem is that you keep rewriting the same manager setup and CRD manifests, this is aimed at you. If your problem is that your controllers are slow at runtime, scaffolding will not help.
How the scaffolding, generators and plugins fit together
Kubebuilder is a CLI that writes files into your repository, and a library that other tools can import. The README says it is developed on top of controller-runtime and controller-tools, and that it can be used as a library, with Operator-SDK as the example of a project that does so. That layering matters when you debug. When a generated controller misbehaves at runtime, the code you are reading comes from controller-runtime; when a CRD manifest is wrong, the generator is controller-tools. Kubebuilder's own job is deciding what to emit. The plugin architecture is how it decides. The README describes plugins as a way for users to take advantage of optional helpers and features, and points to a plugin section of the book. The deploy-image plugin is the documented example: it scaffolds API and controllers that deploy and manage an operand image on the cluster, following what the README calls guidelines and best practices, while leaving the generated code customizable. The design philosophy in DESIGN.md is worth reading before you fight the generator. It states a preference order: Go interfaces and libraries first, code generation second, one-time init of stubs third, and never forking and modifying boilerplate. In practice that means the generated code is expected to be edited by you, but the parts the generators own are regenerated, so hand edits to those parts get overwritten. The markers, the comments that begin with a plus sign, are the interface between your types and the generators. That is the mechanism to learn first.
Installing Kubebuilder and running kubebuilder init
The README is explicit that you should use a released version and that release binaries live on the releases page, with installation instructions in the quick-start chapter of the book. The repository's own Makefile is for building Kubebuilder from source, not for end users, so treat it as contributor tooling. The exact download URL and checksum for your platform are on the book's installation page, which the README links to rather than reproducing.
The documented workflow starts with creating a new project directory and initializing the project. The README lists that as step one of the developer workflow it facilitates, and the quick-start chapter carries the commands. From there you create one or more resource APIs as CRDs and add fields to the resources, then implement reconcile loops in controllers and watch additional resources. Testing happens against a cluster, where the README says the framework self-installs CRDs and starts controllers automatically, and you then update the bootstrapped integration tests to cover new fields and business logic. The final step in that list is building and publishing a container from the provided Dockerfile. The commands themselves are not reproduced in the README text; it defers to the quick-start page for them, so copy them from there rather than from any second-hand source.
Where Kubebuilder gets in your way
The platform support is the first hard limit. The README states that Kubebuilder officially supports macOS and Linux, that Windows users should read docs/windows.md, and that contributions towards supporting Windows are not planned. That is not a soft preference; it is a stated boundary, and it means a Windows-based team is on a documented workaround path rather than a supported one. The second limit is language. The README frames Kubebuilder as building APIs in Go and describes Operator-SDK's Ansible and Helm-based language operators as a separate project's plugins. If you want to write an operator in Python or Ansible, Kubebuilder is the wrong entry point; you would be adopting Operator-SDK, which uses Kubebuilder as a library underneath. The third issue is the generator contract. Because the philosophy prefers code generation over one-time stubs, some files are regenerated, and edits to generated regions do not survive. Teams that treat the scaffold as ordinary source and edit freely tend to hit this repeatedly. The fourth is version coupling. The book has a section on versions compatibility and supportability, and the repository carries a VERSIONING.md. A Kubebuilder release is tied to particular Kubernetes API machinery versions, so upgrading Kubebuilder can mean regenerating manifests and adjusting to changed defaults. None of these are bugs. They are the cost of a framework that owns your project layout.
Kubebuilder against Operator-SDK and controller-runtime
These three are often compared and they are not the same kind of thing. controller-runtime is the library that actually runs your manager, watches resources and calls your reconciler. Kubebuilder is built on top of it. If you compare Kubebuilder to controller-runtime, the honest answer is that Kubebuilder is a scaffolding and generation layer over it, and the generated controller code is controller-runtime code. Operator-SDK is the closer comparison, and the README gives the relationship directly: Operator-SDK uses Kubebuilder as a library and uses the plugin feature to include non-Go operators, specifically Ansible and Helm based language operators. So the difference in approach is scope. Kubebuilder is the Go-only SDK with a plugin mechanism; Operator-SDK is a broader CLI that wraps it and adds non-Go runtimes. If your team writes Go, Kubebuilder is the smaller dependency and you avoid the extra layer. If you need Helm or Ansible operators, or you want one CLI across several operator types, Operator-SDK is the one that ships that path. The trade-off is that the broader tool carries more surface area and its own release cadence on top of Kubebuilder's. If you want to build your own scaffolding for a different language or a house style, the README's pointer to creating your own plugins is the documented route.
Maintenance, releases and licence
The repository is not archived and the last push was on 2026-09-16, five days before this writing, so the project is actively developed. The release cadence visible in the recent tags is roughly every six to ten weeks: v4.14.0 on 2026-04-30, v4.15.0 on 2026-06-15, and v4.16.0 on 2026-09-10. That is frequent enough that pinning a version in CI is worth doing rather than tracking latest. The module path is sigs.k8s.io/kubebuilder/v4, and go.mod declares go 1.26.0, so your toolchain has to be at least that new to build the project itself. One detail in go.mod is a retraction: v4.10.0 is retracted because an invalid filename causes go get and go install to fail. Go's module system honors retractions, so a pinned v4.10.0 will warn or fail rather than silently work. Check your pins. The licence is Apache-2.0, the same licence as the Kubernetes project, which permits commercial and closed-source use and requires you to preserve notices and state changes. That is a summary of the identifier, not legal advice; your own counsel should confirm obligations for your distribution model. Upgrade cost is mostly regeneration: because the generators own parts of the tree, moving between Kubebuilder majors means re-running the scaffolding commands and reconciling the diff against your hand-written logic, plus checking the version compatibility section of the book against your cluster.
Editorial conclusion
Adopt Kubebuilder if you are writing a Kubernetes operator in Go and want the canonical project layout, code generation and envtest harness rather than a hand-rolled controller. Do not adopt it if you need a non-Go operator, since that path runs through Operator-SDK's plugins, or if you need Windows support, which the README says is not planned. Before committing, check the version compatibility and supportability section of the book against your Kubernetes cluster version, and confirm whether you need the deploy-image plugin, which is marked v1-alpha.
Frequently asked questions
How do I install Kubebuilder?
The README recommends using a released version and says release binaries are available on the releases page, with installation instructions in the quick-start chapter of the Kubebuilder book. It does not document a package manager install.
What is Kubebuilder?
It is a framework for building Kubernetes APIs using custom resource definitions, written in Go and developed on top of controller-runtime and controller-tools. The README describes it as increasing velocity and reducing the complexity of building and publishing Kubernetes APIs.
How to build a Kubernetes operator with Kubebuilder?
The README lays out the workflow: create a project directory, define one or more resource APIs as CRDs, implement reconcile loops in controllers and watch additional resources, test against a cluster where CRDs self-install and controllers start automatically, then update the bootstrapped integration tests and build a container from the provided Dockerfile.
How does Kubebuilder compare with Operator-SDK?
Operator-SDK uses Kubebuilder as a library and uses the plugin feature to include non-Go operators, such as its Ansible and Helm-based language operators. Kubebuilder itself is the Go SDK and the plugin mechanism underneath.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/kubernetes-sigs-kubebuilder)