Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions docs/book/src/plugins/deploy-image-plugin-v1-alpha.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ The deploy-image plugin allows users to create [controllers][controller-runtime]
the guidelines and best practices. It abstracts the complexities to achieve this goal while allowing users to improve and customize their projects.

By using this plugin you will have:

- a controller implementation to Deploy and manage an Operand(image) on the cluster
- tests to check the reconciliation implemented using [ENVTEST][envtest]
- the custom resources samples updated with the specs used
Expand Down Expand Up @@ -32,6 +33,19 @@ Then, by using this plugin you can [create APIs](https://book.kubebuilder.io/cro
kubebuilder create api --group example.com --version v1alpha1 --kind Memcached --image=memcached:1.6.15-alpine --image-container-command="memcached,-m=64,modern,-v" --image-container-port="11211" --run-as-user="1001" --plugins="deploy-image/v1-alpha"
```

<aside class="warning">
<h1>Using make run</h1>

The `make run` will execute the `main.go` outside of the cluster to let you test the project running it locally. Note that by using this plugin the Operand image informed will be stored via an environment variable in the `config/manager/manager.yaml` manifest.

Therefore, before run `make run` you need to export any environment variable that you might have. Example:

```sh
export MEMCACHED_IMAGE="memcached:1.4.36-alpine"
```

</aside>

## Subcommands

The deploy-image plugin implements the following subcommands:
Expand All @@ -48,8 +62,8 @@ With the `create api` command of this plugin, in addition to the existing scaffo
- `api/<version>/*_types.go` (scaffold the specs for the new api)
- `config/samples/*_.yaml` (scaffold default values for its CR)
- `main.go` (update to add controller setup)
- `config/manager.yaml` (update with envvar to store the image)
- `config/manager/manager.yaml` (update with envvar to store the image)

[controller-runtime]: https://github.com/kubernetes-sigs/controller-runtime
[testdata]: https://github.com/kubernetes-sigs/kubebuilder/tree/master/testdata/
[envtest]: ../reference/envtest.md
[envtest]: ../reference/envtest.md