go/v4 (go.kubebuilder.io/v4)
(Default Scaffold)
Kubebuilder will scaffold using the go/v4
plugin only if specified when initializing the project.
This plugin is a composition of the kustomize.common.kubebuilder.io/v2
and base.go.kubebuilder.io/v4
plugins
using the Bundle Plugin. It scaffolds a project template
that helps in constructing sets of controllers.
By following the quickstart and creating any project, you will be using this plugin by default.
How to use it ?
To create a new project with the go/v4
plugin the following command can be used:
kubebuilder init --domain tutorial.kubebuilder.io --repo tutorial.kubebuilder.io/project --plugins=go/v4
Subcommands supported by the plugin
- Init -
kubebuilder init [OPTIONS]
- Edit -
kubebuilder edit [OPTIONS]
- Create API -
kubebuilder create api [OPTIONS]
- Create Webhook -
kubebuilder create webhook [OPTIONS]
Further resources
- To see the composition of plugins, you can check the source code for the Kubebuilder main.go.
- Check the code implementation of the base Golang plugin
base.go.kubebuilder.io/v4
. - Check the code implementation of the Kustomize/v2 plugin.
- Check controller-runtime to know more about controllers.