Skip to content

Commit c7c699a

Browse files
authored
Merge pull request #3628 from camilamacedo86/fix-readme
🐛 (go/v4): fix readme content and instructions
2 parents 0827940 + 0885a2c commit c7c699a

File tree

7 files changed

+222
-242
lines changed

7 files changed

+222
-242
lines changed

docs/book/src/component-config-tutorial/testdata/project/README.md

Lines changed: 32 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,73 +5,70 @@
55
// TODO(user): An in-depth paragraph about your project and overview of use
66

77
## Getting Started
8-
You’ll need a Kubernetes cluster to run against. You can use [KIND](https://sigs.k8s.io/kind) to get a local cluster for testing, or run against a remote cluster.
9-
**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows).
108

11-
### Running on the cluster
12-
1. Install Instances of Custom Resources:
9+
### Prerequisites
10+
- go version v1.20.0+
11+
- docker version 17.03+.
12+
- kubectl version v1.11.3+.
13+
- Access to a Kubernetes v1.11.3+ cluster.
1314

14-
```sh
15-
kubectl apply -k config/samples/
16-
```
17-
18-
2. Build and push your image to the location specified by `IMG`:
15+
### To Deploy on the cluster
16+
**Build and push your image to the location specified by `IMG`:**
1917

2018
```sh
2119
make docker-build docker-push IMG=<some-registry>/project:tag
2220
```
2321

24-
3. Deploy the controller to the cluster with the image specified by `IMG`:
22+
**NOTE:** This image ought to be published in the personal registry you specified.
23+
And it is required to have access to pull the image from the working environment.
24+
Make sure you have the proper permission to the registry if the above commands don’t work.
25+
26+
**Install the CRDs into the cluster:**
2527

2628
```sh
27-
make deploy IMG=<some-registry>/project:tag
29+
make install
2830
```
2931

30-
### Uninstall CRDs
31-
To delete the CRDs from the cluster:
32+
**Deploy the Manager to the cluster with the image specified by `IMG`:**
3233

3334
```sh
34-
make uninstall
35+
make deploy IMG=<some-registry>/project:tag
3536
```
3637

37-
### Undeploy controller
38-
UnDeploy the controller from the cluster:
38+
> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin
39+
privileges or be logged in as admin.
40+
41+
**Create instances of your solution**
42+
You can apply the samples (examples) from the config/sample:
3943

4044
```sh
41-
make undeploy
45+
kubectl apply -k config/samples/
4246
```
4347

44-
## Contributing
45-
// TODO(user): Add detailed information on how you would like others to contribute to this project
46-
47-
### How it works
48-
This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/).
48+
>**NOTE**: Ensure that the samples has default values to test it out.
4949
50-
It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/),
51-
which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.
52-
53-
### Test It Out
54-
1. Install the CRDs into the cluster:
50+
### To Uninstall
51+
**Delete the instances (CRs) from the cluster:**
5552

5653
```sh
57-
make install
54+
kubectl delete -k config/samples/
5855
```
5956

60-
2. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running):
57+
**Delete the APIs(CRDs) from the cluster:**
6158

6259
```sh
63-
make run
60+
make uninstall
6461
```
6562

66-
**NOTE:** You can also run this in one step by running: `make install run`
67-
68-
### Modifying the API definitions
69-
If you are editing the API definitions, generate the manifests such as CRs or CRDs using:
63+
**UnDeploy the controller from the cluster:**
7064

7165
```sh
72-
make manifests
66+
make undeploy
7367
```
7468

69+
## Contributing
70+
// TODO(user): Add detailed information on how you would like others to contribute to this project
71+
7572
**NOTE:** Run `make --help` for more information on all potential `make` targets
7673

7774
More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html)

docs/book/src/cronjob-tutorial/testdata/project/README.md

Lines changed: 32 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,73 +5,70 @@
55
// TODO(user): An in-depth paragraph about your project and overview of use
66

77
## Getting Started
8-
You’ll need a Kubernetes cluster to run against. You can use [KIND](https://sigs.k8s.io/kind) to get a local cluster for testing, or run against a remote cluster.
9-
**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows).
108

11-
### Running on the cluster
12-
1. Install Instances of Custom Resources:
9+
### Prerequisites
10+
- go version v1.20.0+
11+
- docker version 17.03+.
12+
- kubectl version v1.11.3+.
13+
- Access to a Kubernetes v1.11.3+ cluster.
1314

14-
```sh
15-
kubectl apply -k config/samples/
16-
```
17-
18-
2. Build and push your image to the location specified by `IMG`:
15+
### To Deploy on the cluster
16+
**Build and push your image to the location specified by `IMG`:**
1917

2018
```sh
2119
make docker-build docker-push IMG=<some-registry>/project:tag
2220
```
2321

24-
3. Deploy the controller to the cluster with the image specified by `IMG`:
22+
**NOTE:** This image ought to be published in the personal registry you specified.
23+
And it is required to have access to pull the image from the working environment.
24+
Make sure you have the proper permission to the registry if the above commands don’t work.
25+
26+
**Install the CRDs into the cluster:**
2527

2628
```sh
27-
make deploy IMG=<some-registry>/project:tag
29+
make install
2830
```
2931

30-
### Uninstall CRDs
31-
To delete the CRDs from the cluster:
32+
**Deploy the Manager to the cluster with the image specified by `IMG`:**
3233

3334
```sh
34-
make uninstall
35+
make deploy IMG=<some-registry>/project:tag
3536
```
3637

37-
### Undeploy controller
38-
UnDeploy the controller from the cluster:
38+
> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin
39+
privileges or be logged in as admin.
40+
41+
**Create instances of your solution**
42+
You can apply the samples (examples) from the config/sample:
3943

4044
```sh
41-
make undeploy
45+
kubectl apply -k config/samples/
4246
```
4347

44-
## Contributing
45-
// TODO(user): Add detailed information on how you would like others to contribute to this project
46-
47-
### How it works
48-
This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/).
48+
>**NOTE**: Ensure that the samples has default values to test it out.
4949
50-
It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/),
51-
which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.
52-
53-
### Test It Out
54-
1. Install the CRDs into the cluster:
50+
### To Uninstall
51+
**Delete the instances (CRs) from the cluster:**
5552

5653
```sh
57-
make install
54+
kubectl delete -k config/samples/
5855
```
5956

60-
2. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running):
57+
**Delete the APIs(CRDs) from the cluster:**
6158

6259
```sh
63-
make run
60+
make uninstall
6461
```
6562

66-
**NOTE:** You can also run this in one step by running: `make install run`
67-
68-
### Modifying the API definitions
69-
If you are editing the API definitions, generate the manifests such as CRs or CRDs using:
63+
**UnDeploy the controller from the cluster:**
7064

7165
```sh
72-
make manifests
66+
make undeploy
7367
```
7468

69+
## Contributing
70+
// TODO(user): Add detailed information on how you would like others to contribute to this project
71+
7572
**NOTE:** Run `make --help` for more information on all potential `make` targets
7673

7774
More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html)

pkg/plugins/golang/v4/scaffolds/internal/templates/readme.go

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,13 @@ func (f *Readme) SetTemplateDefaults() error {
4545
"*/", "", 1)
4646

4747
f.TemplateBody = fmt.Sprintf(readmeFileTemplate,
48-
codeFence("kubectl apply -k config/samples/"),
4948
codeFence("make docker-build docker-push IMG=<some-registry>/{{ .ProjectName }}:tag"),
49+
codeFence("make install"),
5050
codeFence("make deploy IMG=<some-registry>/{{ .ProjectName }}:tag"),
51+
codeFence("kubectl apply -k config/samples/"),
52+
codeFence("kubectl delete -k config/samples/"),
5153
codeFence("make uninstall"),
52-
codeFence("make undeploy"),
53-
codeFence("make install"),
54-
codeFence("make run"),
55-
codeFence("make manifests"))
54+
codeFence("make undeploy"))
5655

5756
return nil
5857
}
@@ -65,57 +64,56 @@ const readmeFileTemplate = `# {{ .ProjectName }}
6564
// TODO(user): An in-depth paragraph about your project and overview of use
6665
6766
## Getting Started
68-
You’ll need a Kubernetes cluster to run against. You can use [KIND](https://sigs.k8s.io/kind) to get a local cluster for testing, or run against a remote cluster.
69-
**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster ` + "`kubectl cluster-info`" + ` shows).
7067
71-
### Running on the cluster
72-
1. Install Instances of Custom Resources:
68+
### Prerequisites
69+
- go version v1.20.0+
70+
- docker version 17.03+.
71+
- kubectl version v1.11.3+.
72+
- Access to a Kubernetes v1.11.3+ cluster.
7373
74-
%s
75-
76-
2. Build and push your image to the location specified by ` + "`IMG`" + `:
74+
### To Deploy on the cluster
75+
**Build and push your image to the location specified by ` + "`IMG`" + `:**
7776
7877
%s
7978
80-
3. Deploy the controller to the cluster with the image specified by ` + "`IMG`" + `:
81-
82-
%s
79+
**NOTE:** This image ought to be published in the personal registry you specified.
80+
And it is required to have access to pull the image from the working environment.
81+
Make sure you have the proper permission to the registry if the above commands don’t work.
8382
84-
### Uninstall CRDs
85-
To delete the CRDs from the cluster:
83+
**Install the CRDs into the cluster:**
8684
8785
%s
8886
89-
### Undeploy controller
90-
UnDeploy the controller from the cluster:
87+
**Deploy the Manager to the cluster with the image specified by ` + "`IMG`" + `:**
9188
9289
%s
9390
94-
## Contributing
95-
// TODO(user): Add detailed information on how you would like others to contribute to this project
91+
> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin
92+
privileges or be logged in as admin.
9693
97-
### How it works
98-
This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/).
94+
**Create instances of your solution**
95+
You can apply the samples (examples) from the config/sample:
96+
97+
%s
9998
100-
It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/),
101-
which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.
99+
>**NOTE**: Ensure that the samples has default values to test it out.
102100
103-
### Test It Out
104-
1. Install the CRDs into the cluster:
101+
### To Uninstall
102+
**Delete the instances (CRs) from the cluster:**
105103
106104
%s
107105
108-
2. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running):
106+
**Delete the APIs(CRDs) from the cluster:**
109107
110108
%s
111109
112-
**NOTE:** You can also run this in one step by running: ` + "`make install run`" + `
113-
114-
### Modifying the API definitions
115-
If you are editing the API definitions, generate the manifests such as CRs or CRDs using:
110+
**UnDeploy the controller from the cluster:**
116111
117112
%s
118113
114+
## Contributing
115+
// TODO(user): Add detailed information on how you would like others to contribute to this project
116+
119117
**NOTE:** Run ` + "`make --help`" + ` for more information on all potential ` + "`make`" + ` targets
120118
121119
More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html)

0 commit comments

Comments
 (0)