Skip to content

Commit e193602

Browse files
authored
Merge pull request #34 from seans3/docs-update
"kubebuilder create config" not "installer containers"
2 parents 9bb1868 + b4ff67e commit e193602

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

docs/tools_user_guide.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ This will setup the initial structure for your project with:
7070

7171
- An empty boilerplate.go.txt (if one doesn't already exist)
7272
- Base `vendor/` go libraries and Gopkg.toml / Gopkg.lock (extracted from the kubebuilder installation directory)
73-
- Dockerfiles for creating your project's container images
73+
- Dockerfile for creating your project's container image
7474
- Optionally: A Bazel workspace and BUILD.bazel
7575
- use the `--bazel` flag to enable this
7676

@@ -141,30 +141,32 @@ go test ./pkg/...
141141

142142
## Build and run an image for your CRD and Controller
143143

144-
`Dockerfile`s for the controller-manager and installer containers were created at the project root.
144+
`A Dockerfile for the controller-manager was created at the project root.
145145
The controller-manager Dockerfile will build the controller-manager from source and also run the tests under
146146
`./pkg/...` and `./cmd/...`.
147147

148148
```sh
149-
docker build . -f Dockerfile.install -t <install-image>:<version> && docker push <install-image>:<version>
150149
docker build . -f Dockerfile.controller -t <controller-image>:<version> && docker push <controller-image>:<version>
151150
```
152151

153-
### Install using the container images
152+
### Generate and apply the configuration to install the CRD and run the controller manager
154153

155-
To install the controller-manager into a cluster using the installer container - create an installer serviceaccount
156-
and run the installer container.
154+
```sh
155+
OUTPUT_YAML_FILE=hack/install.yaml
156+
kubebuilder create config --name=<my-project-name> --controller-image=<controller-image> --output=$OUTPUT_YAML_FILE
157+
```
158+
159+
This generates the YAML config to create the following resources:
160+
161+
* Namespace
162+
* ClusterRole
163+
* ClusterRoleBinding
164+
* CustomResourceDefinition
165+
* Service
166+
* StatefulSet (or Deployment)
157167

158168
```sh
159-
kubectl create serviceaccount installer
160-
kubectl create clusterrolebinding installer-cluster-admin-binding --clusterrole=cluster-admin \
161-
--serviceaccount=default:installer
162-
163-
export NAME=my-project-name
164-
export INSTALL_IMAGE=<install-image>
165-
export CONTROLLER_IMAGE=<controller-image>
166-
kubectl run $NAME --serviceaccount=installer --image=$INSTALL_IMAGE --restart=OnFailure -- ./installer \
167-
--controller-image=$CONTROLLER_IMAGE --name=$NAME
169+
kubectl apply -f $OUTPUT_YAML_FILE
168170
```
169171

170172
## Build docs for your APIs
@@ -180,4 +182,4 @@ kubebuilder create example --group group --version version --kind kind
180182
kubebuilder docs
181183
```
182184

183-
For more information see [creating reference documentation](creating_reference_documentation.md)
185+
For more information see [creating reference documentation](creating_reference_documentation.md)

0 commit comments

Comments
 (0)