Creating a custom resource with Kubebuilder
Initialize the project in $GOPATH/src/...
$ kubebuilder init --domain raker22.com
Create APIs
$ kubebuilder create api --group foo --version v1 --kind Foo
$ kubebuilder create api --group foo --version v1 --kind FooReplicaSet
- Add properties to types
- Install custom resource definitions (CRDs)
- Update controllers with desired behavior
- Create and apply sample resources to see how the controllers behave
- Connect to the kubernetes cluster you want to run the manager on.
- Run
make run
to start the manager on the cluster. - In another terminal run
kubectl apply -f config/samples/<group>-<version>-<kind>.yaml
to create a sample resource.group
,version
, andkind
are the lower case group, version, and kind fromkubebulder create api
above.