diff --git a/docs/tools_user_guide.md b/docs/tools_user_guide.md index 81e99d4f334..1e00270c4c2 100644 --- a/docs/tools_user_guide.md +++ b/docs/tools_user_guide.md @@ -70,7 +70,7 @@ This will setup the initial structure for your project with: - An empty boilerplate.go.txt (if one doesn't already exist) - Base `vendor/` go libraries and Gopkg.toml / Gopkg.lock (extracted from the kubebuilder installation directory) -- Dockerfiles for creating your project's container images +- Dockerfile for creating your project's container image - Optionally: A Bazel workspace and BUILD.bazel - use the `--bazel` flag to enable this @@ -141,30 +141,32 @@ go test ./pkg/... ## Build and run an image for your CRD and Controller -`Dockerfile`s for the controller-manager and installer containers were created at the project root. +`A Dockerfile for the controller-manager was created at the project root. The controller-manager Dockerfile will build the controller-manager from source and also run the tests under `./pkg/...` and `./cmd/...`. ```sh -docker build . -f Dockerfile.install -t : && docker push : docker build . -f Dockerfile.controller -t : && docker push : ``` -### Install using the container images +### Generate and apply the configuration to install the CRD and run the controller manager -To install the controller-manager into a cluster using the installer container - create an installer serviceaccount -and run the installer container. +```sh +OUTPUT_YAML_FILE=hack/install.yaml +kubebuilder create config --name= --controller-image= --output=$OUTPUT_YAML_FILE +``` + +This generates the YAML config to create the following resources: + +* Namespace +* ClusterRole +* ClusterRoleBinding +* CustomResourceDefinition +* Service +* StatefulSet (or Deployment) ```sh -kubectl create serviceaccount installer -kubectl create clusterrolebinding installer-cluster-admin-binding --clusterrole=cluster-admin \ - --serviceaccount=default:installer - -export NAME=my-project-name -export INSTALL_IMAGE= -export CONTROLLER_IMAGE= -kubectl run $NAME --serviceaccount=installer --image=$INSTALL_IMAGE --restart=OnFailure -- ./installer \ - --controller-image=$CONTROLLER_IMAGE --name=$NAME +kubectl apply -f $OUTPUT_YAML_FILE ``` ## Build docs for your APIs @@ -180,4 +182,4 @@ kubebuilder create example --group group --version version --kind kind kubebuilder docs ``` -For more information see [creating reference documentation](creating_reference_documentation.md) \ No newline at end of file +For more information see [creating reference documentation](creating_reference_documentation.md)