Plugins - The Kubebuilder Book (original) (raw)

The Kubebuilder Book

Plugins

Kubebuilder’s architecture is fundamentally plugin-based. This design enables the Kubebuilder CLI to evolve while maintaining backward compatibility with older versions, allowing users to opt-in or opt-out of specific features, and enabling seamless integration with external tools.

By leveraging plugins, projects can extend Kubebuilder and use it as a library to support new functionalities or implement custom scaffolding tailored to their users’ needs. This flexibility allows maintainers to build on top of Kubebuilder’s foundation, adapting it to specific use cases while benefiting from its powerful scaffolding engine.

Plugins offer several key advantages:

For example, to initialize a project with multiple global plugins:

kubebuilder init --plugins=pluginA,pluginB,pluginC

For example, to apply custom scaffolding using specific plugins:

kubebuilder create api --plugins=pluginA,pluginB,pluginC
OR
kubebuilder create webhook --plugins=pluginA,pluginB,pluginC
OR
kubebuilder edit --plugins=pluginA,pluginB,pluginC

This section details the available plugins, how to extend Kubebuilder, and how to create your own plugins while following the same layout structures.