Skip to content

Commit

Permalink
Merge pull request #34 from seans3/docs-update
Browse files Browse the repository at this point in the history
"kubebuilder create config" not "installer containers"
  • Loading branch information
seans3 authored Mar 23, 2018
2 parents 9bb1868 + b4ff67e commit e193602
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions docs/tools_user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 <install-image>:<version> && docker push <install-image>:<version>
docker build . -f Dockerfile.controller -t <controller-image>:<version> && docker push <controller-image>:<version>
```

### 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=<my-project-name> --controller-image=<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=<install-image>
export CONTROLLER_IMAGE=<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
Expand All @@ -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)
For more information see [creating reference documentation](creating_reference_documentation.md)

0 comments on commit e193602

Please sign in to comment.