File tree Expand file tree Collapse file tree 3 files changed +44
-0
lines changed Expand file tree Collapse file tree 3 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -30,10 +30,16 @@ kubebuilder init --domain example.com
30
30
31
31
# Create a new API and controller
32
32
kubebuilder create resource --group bar --version v1alpha1 --kind Foo
33
+ kubectl apply -f hack/sample/foo.yaml
33
34
34
35
# Install and run your API into the cluster for your current kubeconfig context
35
36
GOBIN=$( pwd) /bin go install < PROJECT_PACKAGE> /cmd/controller-manager
36
37
bin/controller-manager --kubeconfig ~ /.kube/config
38
+ kubectl apply -f hack/sample/foo.yaml
39
+
40
+ # Build your documentation
41
+ kubebuilder create example --group bar --version v1alpha1 --kind Foo
42
+ kubebuilder docs
37
43
```
38
44
39
45
See the [ user guide] ( docs/tools_user_guide.md ) for more details
Original file line number Diff line number Diff line change
1
+ # Building reference documentation
2
+
3
+ ## Build reference documentation
4
+
5
+ You may build Kubernetes style reference documentation for your APIs to ` docs/reference/build/index.html ` by
6
+ running ` kubebuilder docs ` .
7
+
8
+ ** Note:** There is currently an issue where building docs does not work if multiple versions of APIs for the
9
+ same group are defined.
10
+
11
+ ## Create an example for your API
12
+
13
+ You may create an example that will be included in the reference documentation by running the following command
14
+ and editing the newly created file:
15
+
16
+ ``` sh
17
+ kubebuilder create example --group < group> --version < version> --kind < kind>
18
+ ```
19
+
20
+ ## Add overview or API group documentation
21
+
22
+ You may add information about the API groups or creating an overview by editing the .md files
23
+ under ` docs/reference/static_includes ` .
Original file line number Diff line number Diff line change @@ -166,3 +166,18 @@ export CONTROLLER_IMAGE=<controller-image>
166
166
kubectl run $NAME --serviceaccount=installer --image=$INSTALL_IMAGE --restart=OnFailure -- ./installer \
167
167
--controller-image=$CONTROLLER_IMAGE --name=$NAME
168
168
```
169
+
170
+ ## Build docs for your APIs
171
+
172
+ It will be helpful for your users to have API documentation. You can generate Kubernetes style APIs using
173
+ kubebuilder:
174
+
175
+ ``` sh
176
+ # Create and edit an example for each API
177
+ kubebuilder create example --group group --version version --kind kind
178
+
179
+ # Generate the docs to docs/reference/build/index.html
180
+ kubebuilder docs
181
+ ```
182
+
183
+ For more information see [ creating reference documentation] ( creating_reference_documentation.md )
You can’t perform that action at this time.
0 commit comments