Kubebuilder provides an extensible architecture to scaffold projects using plugins. These plugins allow you to customize the CLI behavior or integrate new features.
Kubebuilder’s CLI can be extended through custom plugins, allowing you to:
- Build new scaffolds.
- Enhance existing ones.
- Add new commands and functionality to Kubebuilder’s scaffolding.
This flexibility enables you to create custom project setups tailored to specific needs.
Kubebuilder and SDK are both broadly adopted projects which leverage the controller-runtime project. They both allow users to build solutions using the Operator Pattern and follow common standards.
Adopting these standards can bring significant benefits, such as joining forces on maintaining the common standards as the features provided by Kubebuilder and take advantage of the contributions made by the community. This allows you to focus on the specific needs and requirements for your plugin and use-case.
And then, you will also be able to use custom plugins and options currently or in the future which might to be provided by these projects as any other which decides to persuade the same standards.
Extending Kubebuilder can be achieved in two main ways:
-
Extending CLI features and Plugins: You can import and build upon existing Kubebuilder plugins to extend its features and plugins. This is useful when you need to add specific features to a tool that already benefits from Kubebuilder's scaffolding system. For example, Operator SDK leverages the kustomize plugin to provide language support for tools like Ansible or Helm. So that the project can be focused to keep maintained only what is specific language based.
-
Creating External Plugins: You can build standalone, independent plugins as binaries. These plugins can be written in any language and should follow an execution pattern that Kubebuilder recognizes. For more information, see Creating external plugins.
For further details on how to extend Kubebuilder, explore the following sections:
- CLI and Plugins to learn how to extend CLI features and plugins.
- External Plugins for creating standalone plugins.
- E2E Tests to ensure your plugin functions as expected.