Skip to content

Commit ed70df6

Browse files
authored
Merge pull request #2 from chethanm99/chethanm99-patch-1
Update code-generate-image-plugin.md
2 parents 33675ce + 0e10bd2 commit ed70df6

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

designs/code-generate-image-plugin.md

+22-22
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## Summary
88

9-
This proposal defines a new plugin which allow users get the scaffold with the
9+
This proposal defines a new plugin that allows users to 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.
1111

1212
## Motivation
@@ -18,24 +18,24 @@ The biggest part of the Kubebuilder users looking for to create a project that w
1818
### Goals
1919

2020
- Add a new plugin to generate the code required to deploy and manage an image on the cluster
21-
- Promote the best practices as give example of common implementations
22-
- Make the process to develop operators projects easier and more agil.
21+
- Promote the best practices by giving examples of common implementations
22+
- Make the process of developing operator's projects easier and more agile.
2323
- Give flexibility to the users and allow them to change the code according to their needs
24-
- Provide examples of code implementations and of the most common features usage and reduce the learning curve
24+
- Provide examples of code implementations and of the usage of the most common features and reduce the learning curve
2525

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 to 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; scaffolding the project using webhooks and the controller covered by tests.
3131

3232
## Proposal
3333

34-
Add the new plugin code generate which will scaffold code implementation to deploy the image informed which would like such as; `kubebuilder create api --group=crew --version=v1 --image=myexample:0.0.1 --kind=App --plugins=deploy-image.go.kubebuilder.io/v1beta1` which will:
34+
Add the new plugin code generated which will scaffold code implementation to deploy the image informed which would like such as; `kubebuilder create api --group=crew --version=v1 --image=myexample:0.0.1 --kind=App --plugins=deploy-image.go.kubebuilder.io/v1beta1` which will:
3535

36-
- Add a code implementation which will do the Custom Resource reconciliation and create a Deployment resource for the `--image`;
36+
- Add a code implementation that will do the Custom Resource reconciliation and create a Deployment resource for the `--image`;
3737

38-
- Add an EnvVar on the manager manifest (`config/manager/manager.yaml`) which will store the image informed and shows its possibility to users:
38+
- Add an EnvVar on the manager manifest (`config/manager/manager.yaml`) which will store the image informed and show its possibility to users:
3939

4040
```yaml
4141
..
@@ -49,7 +49,7 @@ Add the new plugin code generate which will scaffold code implementation to depl
4949
...
5050
```
5151

52-
- Add a check into reconcile to ensure that the replicas of the deployment on cluster are equals the size defined in the CR:
52+
- Add a check into reconcile to ensure that the replicas of the deployment on the cluster are equal the size defined in the CR:
5353

5454
```go
5555
// Ensure the deployment size is the same as the spec
@@ -83,7 +83,7 @@ func (r *{{ resource }}Reconciler) SetupWithManager(mgr ctrl.Manager) error {
8383
// +kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch;create;update;patch;delete
8484
```
8585

86-
- A status [conditions][conditions] to allow users check that if the deployment occurred successfully or its errors
86+
- A status [conditions][conditions] to allow users to check if the deployment occurred successfully or if its errors
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

@@ -93,9 +93,9 @@ func (r *{{ resource }}Reconciler) SetupWithManager(mgr ctrl.Manager) error {
9393

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 a user, who would like to use a command to scaffold my common need which is to 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 a user, would like to have a good example code base that uses the common features so that I can easily learn its concepts and have a good starting 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.
101101

@@ -251,12 +251,12 @@ type {{ resource }}Spec struct {
251251

252252
### Test Plan
253253

254-
To ensure this implementation a new project example should be generated in the [testdata](../testdata/) directory of the project. See the [test/testdata/generate.sh](../test/testadata/generate.sh). Also, we should use this scaffold in the [integration tests](../test/e2e/) to ensure that the data scaffolded with works on the cluster as expected.
254+
To ensure this implementation a new project example should be generated in the [testdata](../testdata/) directory of the project. See the [test/testdata/generate.sh](../test/testadata/generate.sh). Also, we should use this scaffold in the [integration tests](../test/e2e/) to ensure that the data scaffold works on the cluster as expected.
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 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 gets done with the common basic code implementation:
260260

261261
```yaml
262262
plugins:
@@ -279,22 +279,22 @@ No, at least in the first moment to keep the simplicity.
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
282-
3. Could this feature be useful to other languages or is it just valid to Go based operators?
282+
3. Could this feature be useful to other languages or is it just valid to Go-based operators?
283283
284284
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
286-
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`
286+
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 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 creating 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 does not have too many plugins yet. And then, the preliminary support for plugins was not indeed released. For more info see the [Extensible CLI and Scaffolding Plugins][plugins-phase1-design-doc].
291291
292292
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
294294
5. Is Kubebuilder prepared to receive this implementation already?
295295
296-
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)
296+
The [Extensible CLI and Scaffolding Plugins - Phase 1.5](extensible-cli-and-scaffolding-plugins-phase-1-5.md) and issue #1941 are required to be implemented before this proposal. Also, to have a better idea of the proposed solutions made so for the Plugin Ecosystem see the meta issue [#2016](https://github.com/kubernetes-sigs/kubebuilder/issues/2016)
297297
298298
[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
300-
[plugins-phase1-design-doc]: https://github.com/kubernetes-sigs/kubebuilder/blob/master/designs/extensible-cli-and-scaffolding-plugins-phase-1.md
300+
[plugins-phase1-design-doc]: https://github.com/kubernetes-sigs/kubebuilder/blob/master/designs/extensible-cli-and-scaffolding-plugins-phase-1.md

0 commit comments

Comments
 (0)