Scaffolder

A code-generation tool that bootstraps a component operator skeleton

Overview

The Scaffolder is a CLI tool that generates a ready-to-build operator skeleton based on controller-runtime. The generated project is pre-wired to component-operator-runtime — the main reconciliation loop, the component type scaffolding and status management are all set up so you can focus on writing your domain logic rather than plumbing.

The Scaffolder is conceptually similar to kubebuilder, but more opinionated: it makes concrete choices about project layout, API conventions, and framework integration so you do not have to.

Download the latest binary from the GitHub Releases page.


Usage

The tool is invoked as scaffold and writes the generated project into a target output directory, which must already exist:

scaffold [options] [output directory]

Run scaffold -h to see the full list of options for the current release.

Options

FlagDefaultDescription
--versionShow version
--ownerSAP SEOwner of this project, as written to the license header
--spdx-license-headersfalseWhether to write license headers in SPDX format
--group-nameAPI group name
--group-versionv1alpha1API group version
--kindAPI kind for the component
--resourcepluralized kindAPI resource (plural) for the component
--operator-nameUnique name for this operator, used e.g. for leader election and labels; should be a valid DNS hostname
--with-validating-webhookfalseWhether to scaffold a validating webhook
--with-mutating-webhookfalseWhether to scaffold a mutating webhook
--go-version1.26.4Go version to be used
--go-moduleName of the Go module, as written to the go.mod file
--kubernetes-versionv0.36.0Kubernetes go-client version to be used
--controller-runtime-versionv0.24.1controller-runtime version to be used
--controller-tools-versionv0.21.0controller-tools version to be used
--code-generator-versionv0.36.0code-generator version to be used
--admission-webhook-runtime-versionv0.1.100admission-webhook-runtime version to be used
--envtest-kubernetes-version1.35.0Kubernetes version to be used by envtest
--imagecontroller:latestName of the Docker/OCI image produced by this project
--skip-post-processingfalseSkip post-processing

Examples

Scaffold a basic operator (without admission webhooks):

mkdir scaffold-output
scaffold \
  --group-name example.io \
  --group-version v1alpha1 \
  --kind MyComponent \
  --operator-name mycomponent-operator.example.io \
  --go-module example.io/mycomponent-operator \
  --image mycomponent-operator:latest \
  scaffold-output

Scaffold an operator with validating and mutating admission webhooks:

mkdir scaffold-output
scaffold \
  --group-name example.io \
  --group-version v1alpha1 \
  --kind MyComponent \
  --with-validating-webhook \
  --with-mutating-webhook \
  --operator-name mycomponent-operator.example.io \
  --go-module example.io/mycomponent-operator \
  --image mycomponent-operator:latest \
  scaffold-output

Relationship to kubebuilder

Both tools scaffold controller-runtime projects, but the Scaffolder produces a narrower, more complete starting point:

kubebuilderScaffolder
Framework integrationManualPre-wired to component-operator-runtime
Generator choicen/aHelm / Kustomize / plain YAML
Status managementCustomBuilt-in component status model
Reconciler implementationBoilerplateDelegated to Reconciler[T]

If you are starting a new operator that manages a coherent set of Kubernetes resources and want to skip the framework integration work, the Scaffolder is the fastest path. See also the Getting Started guide for a step-by-step walkthrough.