Skip to content

Update the walkthrough for kubebuilder 3 #172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
12 changes: 3 additions & 9 deletions docs/addon/walkthrough/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This walkthrough is for creating an operator to run the [guestbook](https://gith

Install the following depenencies:

- [kubebuilder](https://book.kubebuilder.io/quick-start.html#installation) (tested with 2.0.0-alpha.4)
- [kubebuilder](https://book.kubebuilder.io/quick-start.html#installation) (tested with 3.1.0)
- [kustomize](https://kubectl.docs.kubernetes.io/installation/kustomize/) (tested with v2.0.3)
- docker
- kubectl
Expand All @@ -18,20 +18,14 @@ Create a new directory and use kubebuilder to scaffold the operator:
export GO111MODULE=on
mkdir -p guestbook-operator/
cd guestbook-operator/
kubebuilder init --domain example.org --license apache2 --owner "TODO($USER): assign copyright"
```

Add the patterns to your project:

```
go get sigs.k8s.io/kubebuilder-declarative-pattern
kubebuilder init --plugins go.kubebuilder.io/v3,declarative.go.kubebuilder.io/v1 --domain example.org --license apache2 --owner "TODO($USER): assign copyright"
```

### Adding our first CRD

```
# generate the API/controllers
kubebuilder create api --controller=true --example=false --group=addons --kind=Guestbook --make=false --namespaced=true --resource=true --version=v1alpha1
kubebuilder create api --controller=true --group=addons --kind=Guestbook --make=false --namespaced=true --resource=true --version=v1alpha1
# remove the test suites that are more checking that kubebuilder is working
find . -name "*_test.go" -delete
```
Expand Down