Skip to content

Commit 2b3287b

Browse files
📖 remove traling spaces of all docs
1 parent 7b36b0e commit 2b3287b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+370
-370
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ Kubebuilder is developed on top of the [controller-runtime][controller-runtime]
2323
### Kubebuilder is also a library
2424

2525
Kubebuilder is extensible and can be used as a library in other projects.
26-
[Operator-SDK][operator-sdk] is a good example of a project that uses Kubebuilder as a library.
26+
[Operator-SDK][operator-sdk] is a good example of a project that uses Kubebuilder as a library.
2727
[Operator-SDK][operator-sdk] uses the plugin feature to include non-Go operators _e.g. operator-sdk's Ansible and Helm-based language Operators_.
2828

29-
To learn more see [how to create your own plugins][your-own-plugins].
29+
To learn more see [how to create your own plugins][your-own-plugins].
3030

3131
### Installation
3232

@@ -39,9 +39,9 @@ See the [Getting Started](https://book.kubebuilder.io/quick-start.html) document
3939

4040
![Quick Start](docs/gif/kb-demo.v3.11.1.svg)
4141

42-
Also, ensure that you check out the [Deploy Image](https://book.kubebuilder.io/plugins/deploy-image-plugin-v1-alpha.html)
43-
Plugin. This plugin allows users to scaffold API/Controllers to deploy and manage an
44-
Operand (image) on the cluster following the guidelines and best practices. It abstracts the
42+
Also, ensure that you check out the [Deploy Image](https://book.kubebuilder.io/plugins/deploy-image-plugin-v1-alpha.html)
43+
Plugin. This plugin allows users to scaffold API/Controllers to deploy and manage an
44+
Operand (image) on the cluster following the guidelines and best practices. It abstracts the
4545
complexities of achieving this goal while allowing users to customize the generated code.
4646

4747
## Documentation
@@ -121,18 +121,18 @@ Before starting any work, please either comment on an existing issue, or file a
121121

122122
## Supportability
123123

124-
Currently, Kubebuilder officially supports OSX and Linux platforms.
125-
So, if you are using a Windows OS you may find issues. Contributions towards
124+
Currently, Kubebuilder officially supports OSX and Linux platforms.
125+
So, if you are using a Windows OS you may find issues. Contributions towards
126126
supporting Windows are welcome.
127127

128128
### Apple Silicon
129129

130130
Apple Silicon (`darwin/arm64`) support begins with the `go/v4` plugin.
131131

132132
## Community Meetings
133-
133+
134134
The following meetings happen biweekly:
135-
135+
136136
- Kubebuilder Meeting
137137

138138
You are more than welcome to attend. For further info join to [kubebuilder@googlegroups.com](https://groups.google.com/g/kubebuilder).

RELEASE.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ process was done to ensure that we have an aligned process under the org (simila
2525
> **Note**
2626
> - You will need to have checkout locally from the remote repository the previous branch
2727
> - Also, ensure that you fetch all tags from the remote `git fetch --all --tags`
28-
> - Also, if you face issues to generate the release notes you might want to able to sort it out by running i.e.:
28+
> - Also, if you face issues to generate the release notes you might want to able to sort it out by running i.e.:
2929
> `go run sigs.k8s.io/kubebuilder-release-tools/notes --use-upstream=false --from=v3.11.0 --branch=release-X`
3030
3131

3232
### Draft a new release from GitHub
3333

3434
1. Create a new tag with the correct version from the new `release-<MAJOR.MINOR>` branch
35-
2. Verify the Release Github Action. It should build the assets and publish in the draft release
35+
2. Verify the Release Github Action. It should build the assets and publish in the draft release
3636
3. You also need to manually add the changelog generated above on the release page and publish it. Now, the code source is released !
3737

3838
### Update the website docs (https://book.kubebuilder.io/quick-start.html)
@@ -75,7 +75,7 @@ This action will caall the job [./build/.goreleaser.yml](./build/.goreleaser.yml
7575
Kubebuilder projects requires artifacts which are used to do test with ENV TEST (when we call `make test` target)
7676
These artifacts can be checked in the service page: https://storage.googleapis.com/kubebuilder-tools
7777

78-
The build is made from the branch [tools-releases](https://github.com/kubernetes-sigs/kubebuilder/tree/tools-releases) and the trigger will call the `build/cloudbuild_tools.yaml` passing
78+
The build is made from the branch [tools-releases](https://github.com/kubernetes-sigs/kubebuilder/tree/tools-releases) and the trigger will call the `build/cloudbuild_tools.yaml` passing
7979
as argument the architecture and the SO that should be used, e.g:
8080

8181
<img width="553" alt="Screenshot 2022-04-30 at 10 15 41" src="https://user-images.githubusercontent.com/7708031/166099666-ae9cd2df-73fe-47f6-a987-464f63df9a19.png">
@@ -91,7 +91,7 @@ These images are can be checked in the consolse, see [here](https://console.clou
9191

9292
The project `kube-rbac-proxy` is in the process to be donated to the k8s org. However, it is going on for a long time and then,
9393
we have no ETA for that to occur. When that occurs we can automate this process. But until there we need to generate these images
94-
by bumping the versions/tags released by `kube-rbac-proxy` on the branch
94+
by bumping the versions/tags released by `kube-rbac-proxy` on the branch
9595
[kube-rbac-proxy-releases](https://github.com/kubernetes-sigs/kubebuilder/tree/kube-rbac-proxy-releases)
9696
then the `build/cloudbuild_kube-rbac-proxy.yaml` will generate the images.
9797

@@ -118,8 +118,8 @@ and not the image, see:
118118
github_token: ${{ secrets.GITHUB_TOKEN }}
119119
```
120120
121-
However, the image should still be built and maintained since other projects under the org might be using them.
121+
However, the image should still be built and maintained since other projects under the org might be using them.
122122
123123
[kubebuilder-release-tools]: https://github.com/kubernetes-sigs/kubebuilder-release-tools
124124
[release-notes-generation]: https://github.com/kubernetes-sigs/kubebuilder-release-tools/blob/master/README.md#release-notes-generation
125-
[release-process]: https://github.com/kubernetes-sigs/kubebuilder/blob/master/VERSIONING.md#releasing
125+
[release-process]: https://github.com/kubernetes-sigs/kubebuilder/blob/master/VERSIONING.md#releasing

designs/code-generate-image-plugin.md

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,26 @@
88

99
This proposal defines a new plugin which allow users get the scaffold with the
1010
required code to have a project that will deploy and manage an image on the cluster following the guidelines and what have been considered as good practices.
11-
11+
1212
## Motivation
1313

14-
The biggest part of the Kubebuilder users looking for to create a project that will at the end only deploy an image. In this way, one of the mainly motivations of this proposal is to abstract the complexities to achieve this goal and still giving the possibility of users improve and customize their projects according to their requirements.
14+
The biggest part of the Kubebuilder users looking for to create a project that will at the end only deploy an image. In this way, one of the mainly motivations of this proposal is to abstract the complexities to achieve this goal and still giving the possibility of users improve and customize their projects according to their requirements.
1515

1616
**Note:** This plugin will address requests that has been raised for a while and for many users in the community. Check [here](https://github.com/operator-framework/operator-sdk/pull/2158), for example, a request done in the past for the SDK project which is integrated with Kubebuidler to address the same need.
1717

1818
### Goals
1919

2020
- Add a new plugin to generate the code required to deploy and manage an image on the cluster
2121
- Promote the best practices as give example of common implementations
22-
- Make the process to develop operators projects easier and more agil.
22+
- Make the process to develop operators projects easier and more agil.
2323
- Give flexibility to the users and allow them to change the code according to their needs
2424
- Provide examples of code implementations and of the most common features usage and reduce the learning curve
25-
25+
2626
### Non-Goals
2727

28-
The idea of this proposal is provide a facility for the users. This plugin can be improved
28+
The idea of this proposal is provide a facility for the users. This plugin can be improved
2929
in the future, however, this proposal just covers the basic requirements. In this way, is a non-goal
30-
allow extra configurations such as; scaffold the project using webhooks and the controller covered by tests.
30+
allow extra configurations such as; scaffold the project using webhooks and the controller covered by tests.
3131

3232
## Proposal
3333

@@ -38,12 +38,12 @@ Add the new plugin code generate which will scaffold code implementation to depl
3838
- Add an EnvVar on the manager manifest (`config/manager/manager.yaml`) which will store the image informed and shows its possibility to users:
3939

4040
```yaml
41-
..
41+
..
4242
spec:
4343
containers:
4444
- name: manager
4545
env:
46-
- name: {{ resource}}-IMAGE
46+
- name: {{ resource}}-IMAGE
4747
value: {{image:tag}}
4848
image: controller:latest
4949
...
@@ -66,9 +66,9 @@ Add the new plugin code generate which will scaffold code implementation to depl
6666
}
6767
```
6868

69-
- Add the watch feature for the Deployment managed by the controller:
69+
- Add the watch feature for the Deployment managed by the controller:
7070

71-
```go
71+
```go
7272
func (r *{{ resource }}Reconciler) SetupWithManager(mgr ctrl.Manager) error {
7373
return ctrl.NewControllerManagedBy(mgr).
7474
For(&cachev1alpha1.{{ resource }}{}).
@@ -87,19 +87,19 @@ func (r *{{ resource }}Reconciler) SetupWithManager(mgr ctrl.Manager) error {
8787

8888
- Add a [marker][markers] in the spec definition to demonstrate how to use OpenAPI schemas validation such as `+kubebuilder:validation:Minimum=1`
8989

90-
- Add the specs on the `_types.go` to generate the CRD/CR sample with default values for `ImagePullPolicy` (`Always`), `ContainerPort` (`80`) and the `Replicas Size` (`3`)
90+
- Add the specs on the `_types.go` to generate the CRD/CR sample with default values for `ImagePullPolicy` (`Always`), `ContainerPort` (`80`) and the `Replicas Size` (`3`)
91+
92+
- Add a finalizer implementation with TODO for the CR managed by the controller such as described in the SDK doc [Handle Cleanup on Deletion](https://sdk.operatorframework.io/docs/building-operators/golang/advanced-topics/#handle-cleanup-on-deletion)
9193

92-
- Add a finalizer implementation with TODO for the CR managed by the controller such as described in the SDK doc [Handle Cleanup on Deletion](https://sdk.operatorframework.io/docs/building-operators/golang/advanced-topics/#handle-cleanup-on-deletion)
93-
9494
### User Stories
9595

96-
- I am as user, would like to use a command to scaffold my common need which is deploy an image of my application, so that I do not need to know exactly how to implement it
96+
- I am as user, would like to use a command to scaffold my common need which is deploy an image of my application, so that I do not need to know exactly how to implement it
9797

98-
- I am as user, would like to have a good example code base which uses the common features, so that I can easily learn its concepts and have a good start point to address my needs.
98+
- I am as user, would like to have a good example code base which uses the common features, so that I can easily learn its concepts and have a good start point to address my needs.
9999

100100
- I am as maintainer, would like to have a good example to address the common questions, so that I can easily describe how to implement the projects and/or use the common features.
101-
102-
### Implementation Details/Notes/Constraints
101+
102+
### Implementation Details/Notes/Constraints
103103

104104
**Example of the controller template**
105105

@@ -160,9 +160,9 @@ func (r *{{ resource }}.Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, er
160160
// Spec updated - return and requeue
161161
return ctrl.Result{Requeue: true}, nil
162162
}
163-
163+
164164
// TODO: add here code implementation to update/manage the status
165-
165+
166166
return ctrl.Result{}, nil
167167
}
168168

@@ -214,7 +214,7 @@ func labelsFor{{ resource }}(name string) map[string]string {
214214
// imageFor{{ resource }} returns the image for the resources
215215
// belonging to the given {{ resource }} CR name.
216216
func imageFor{{ resource }}(name string) string {
217-
// TODO: this method will return the value of the envvar create to store the image:tag informed
217+
// TODO: this method will return the value of the envvar create to store the image:tag informed
218218
}
219219

220220
func (r *{{ resource }}Reconciler) SetupWithManager(mgr ctrl.Manager) error {
@@ -224,7 +224,7 @@ func (r *{{ resource }}Reconciler) SetupWithManager(mgr ctrl.Manager) error {
224224
Complete(r)
225225
}
226226

227-
```
227+
```
228228

229229
**Example of the spec for the <kind>_types.go template**
230230

@@ -241,7 +241,7 @@ type {{ resource }}Spec struct {
241241
// ImagePullPolicy defines the policy to pull the container images
242242
ImagePullPolicy string `json:"image-pull-policy,omitempty"`
243243

244-
// ContainerPort specifies the port which will be used by the image container
244+
// ContainerPort specifies the port which will be used by the image container
245245
ContainerPort int `json:"container-port,omitempty"`
246246

247247
}
@@ -255,8 +255,8 @@ To ensure this implementation a new project example should be generated in the [
255255

256256
### Graduation Criteria
257257

258-
- The new plugin will only be support `project-version=3`
259-
- The attribute image with the value informed should be added to the resources model in the PROJECT file to let the tool know that the Resource get done with the common basic code implementation:
258+
- The new plugin will only be support `project-version=3`
259+
- The attribute image with the value informed should be added to the resources model in the PROJECT file to let the tool know that the Resource get done with the common basic code implementation:
260260

261261
```yaml
262262
plugins:
@@ -267,34 +267,34 @@ plugins:
267267
kind: Captain
268268
version: v1
269269
image: "<some-registry>/<project-name>:<tag>
270-
```
270+
```
271271
272-
For further information check the definition agreement register in the comment https://github.com/kubernetes-sigs/kubebuilder/issues/1941#issuecomment-778649947.
272+
For further information check the definition agreement register in the comment https://github.com/kubernetes-sigs/kubebuilder/issues/1941#issuecomment-778649947.
273273
274-
## Open Questions
274+
## Open Questions
275275
276-
1. Should we allow to scaffold the code for an API that is already created for the project?
277-
No, at least in the first moment to keep the simplicity.
276+
1. Should we allow to scaffold the code for an API that is already created for the project?
277+
No, at least in the first moment to keep the simplicity.
278278
279279
2. Should we support StatefulSet and Deployments?
280280
The idea is we start it by using a Deployment. However, we can improve the feature in follow-ups to support more default types of scaffolds which could be like `kubebuilder create api --group=crew --version=v1 --image=myexample:0.0.1 --kind=App --plugins=deploy-image.go.kubebuilder.io/v1beta1 --type=[deployment|statefulset|webhook]`
281281
282282
3. Could this feature be useful to other languages or is it just valid to Go based operators?
283283
284-
This plugin would is reponsable to scaffold content and files for Go-based operators. In a future, if other language-based operators starts to be supported (either officially or by the community) this plugin could be used as reference to create an equivalent one for their languages. Therefore, it should probably not to be a `subdomain` of `go.kubebuilder.io.`
284+
This plugin would is reponsable to scaffold content and files for Go-based operators. In a future, if other language-based operators starts to be supported (either officially or by the community) this plugin could be used as reference to create an equivalent one for their languages. Therefore, it should probably not to be a `subdomain` of `go.kubebuilder.io.`
285285
286286
For its integration with SDK, it might be valid for the Ansible-based operators where a new `playbook/role` could be generated as well. However, for example, for the Helm plugin it might to be useless. E.g `deploy-image.ansible.sdk.operatorframework.io/v1beta1`
287287
288-
4. Should we consider create a separate repo for plugins?
288+
4. Should we consider create a separate repo for plugins?
289289
290-
In the long term yes. However, see that currently, Kubebuilder has not too many plugins yet. And then, and the preliminary support for plugins did not indeed release. For more info see the [Extensible CLI and Scaffolding Plugins][plugins-phase1-design-doc].
290+
In the long term yes. However, see that currently, Kubebuilder has not too many plugins yet. And then, and the preliminary support for plugins did not indeed release. For more info see the [Extensible CLI and Scaffolding Plugins][plugins-phase1-design-doc].
291291
292-
In this way, at this moment, it shows to be a little Premature Optimization. Note that the issue [#2016](https://github.com/kubernetes-sigs/kubebuilder/issues/1378) will check the possibility of the plugins be as separate binaries that can be discovered by the Kubebuilder CLI binary via user-specified plugin file paths. Then, the discussion over the best approach to dealing with many plugins and if they should or not leave in the Kubebuilder repository would be better addressed after that.
292+
In this way, at this moment, it shows to be a little Premature Optimization. Note that the issue [#2016](https://github.com/kubernetes-sigs/kubebuilder/issues/1378) will check the possibility of the plugins be as separate binaries that can be discovered by the Kubebuilder CLI binary via user-specified plugin file paths. Then, the discussion over the best approach to dealing with many plugins and if they should or not leave in the Kubebuilder repository would be better addressed after that.
293293
294-
5. Is Kubebuilder prepared to receive this implementation already?
294+
5. Is Kubebuilder prepared to receive this implementation already?
295295
296296
The [Extensible CLI and Scaffolding Plugins - Phase 1.5](extensible-cli-and-scaffolding-plugins-phase-1-5.md) and the issue #1941 requires to be implemented before this proposal. Also, to have a better idea over the proposed solutions made so for the Plugin Ecosystem see the meta issue [#2016](https://github.com/kubernetes-sigs/kubebuilder/issues/2016)
297297
298-
[markers]: ../docs/book/src/reference/markers.md
298+
[markers]: ../docs/book/src/reference/markers.md
299299
[conditions]: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties
300300
[plugins-phase1-design-doc]: https://github.com/kubernetes-sigs/kubebuilder/blob/master/designs/extensible-cli-and-scaffolding-plugins-phase-1.md

designs/crd_version_conversion.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This document describes high level design and workflow for supporting multiple v
2020

2121
## Hub and Spoke
2222

23-
The basic concept is that all versions of an object share the storage. So say if you have versions v1, v2 and v3 of a Kind Toy, kubernetes will use one of the versions to persist the object in stable storage i.e. Etcd. User can specify the version to be used for storage in the Custom Resource definition for that API.
23+
The basic concept is that all versions of an object share the storage. So say if you have versions v1, v2 and v3 of a Kind Toy, kubernetes will use one of the versions to persist the object in stable storage i.e. Etcd. User can specify the version to be used for storage in the Custom Resource definition for that API.
2424

2525
One can think storage version as the hub and other versions as spoke to visualize the relationship between storage and other versions (as shown below in the diagram). The key thing to note is that conversion between storage and other version should be lossless (round trippable). As shown in the diagram below, v3 is the storage/hub version and v1, v2 and v4 are spoke version. The document uses storage version and hub interchangeably.
2626

@@ -58,7 +58,7 @@ func (ej *ExternalJob) ConvertTo(dst conversion.Hub) error {
5858
jobv3 := dst.(*v3.ExternalJob)
5959
jobv3.ObjectMeta = ej.ObjectMeta
6060
// conversion implementation
61-
//
61+
//
6262
return nil
6363
default:
6464
return fmt.Errorf("unsupported type %v", t)
@@ -181,7 +181,7 @@ The tool that generates the CRD manifests lives under controller-tools repo. Cur
181181

182182
## Storage/Serve annotations:
183183

184-
The resource annotation will be extended to indicate storage/serve attributes as shown below.
184+
The resource annotation will be extended to indicate storage/serve attributes as shown below.
185185

186186
```Go
187187
// ...

0 commit comments

Comments
 (0)