From 0885a2c63002ff39b85c54723a05090131d3219c Mon Sep 17 00:00:00 2001 From: Camila Macedo Date: Sun, 17 Sep 2023 08:44:57 +0100 Subject: [PATCH] fix readme --- .../testdata/project/README.md | 67 +++++++++---------- .../testdata/project/README.md | 67 +++++++++---------- .../v4/scaffolds/internal/templates/readme.go | 62 +++++++++-------- testdata/project-v4-multigroup/README.md | 67 +++++++++---------- .../project-v4-with-deploy-image/README.md | 67 +++++++++---------- testdata/project-v4-with-grafana/README.md | 67 +++++++++---------- testdata/project-v4/README.md | 67 +++++++++---------- 7 files changed, 222 insertions(+), 242 deletions(-) diff --git a/docs/book/src/component-config-tutorial/testdata/project/README.md b/docs/book/src/component-config-tutorial/testdata/project/README.md index a6dd2e20a6..8a221c0137 100644 --- a/docs/book/src/component-config-tutorial/testdata/project/README.md +++ b/docs/book/src/component-config-tutorial/testdata/project/README.md @@ -5,73 +5,70 @@ // TODO(user): An in-depth paragraph about your project and overview of use ## Getting Started -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. -**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows). -### Running on the cluster -1. Install Instances of Custom Resources: +### Prerequisites +- go version v1.20.0+ +- docker version 17.03+. +- kubectl version v1.11.3+. +- Access to a Kubernetes v1.11.3+ cluster. -```sh -kubectl apply -k config/samples/ -``` - -2. Build and push your image to the location specified by `IMG`: +### To Deploy on the cluster +**Build and push your image to the location specified by `IMG`:** ```sh make docker-build docker-push IMG=/project:tag ``` -3. Deploy the controller to the cluster with the image specified by `IMG`: +**NOTE:** This image ought to be published in the personal registry you specified. +And it is required to have access to pull the image from the working environment. +Make sure you have the proper permission to the registry if the above commands don’t work. + +**Install the CRDs into the cluster:** ```sh -make deploy IMG=/project:tag +make install ``` -### Uninstall CRDs -To delete the CRDs from the cluster: +**Deploy the Manager to the cluster with the image specified by `IMG`:** ```sh -make uninstall +make deploy IMG=/project:tag ``` -### Undeploy controller -UnDeploy the controller from the cluster: +> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin +privileges or be logged in as admin. + +**Create instances of your solution** +You can apply the samples (examples) from the config/sample: ```sh -make undeploy +kubectl apply -k config/samples/ ``` -## Contributing -// TODO(user): Add detailed information on how you would like others to contribute to this project - -### How it works -This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/). +>**NOTE**: Ensure that the samples has default values to test it out. -It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/), -which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster. - -### Test It Out -1. Install the CRDs into the cluster: +### To Uninstall +**Delete the instances (CRs) from the cluster:** ```sh -make install +kubectl delete -k config/samples/ ``` -2. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running): +**Delete the APIs(CRDs) from the cluster:** ```sh -make run +make uninstall ``` -**NOTE:** You can also run this in one step by running: `make install run` - -### Modifying the API definitions -If you are editing the API definitions, generate the manifests such as CRs or CRDs using: +**UnDeploy the controller from the cluster:** ```sh -make manifests +make undeploy ``` +## Contributing +// TODO(user): Add detailed information on how you would like others to contribute to this project + **NOTE:** Run `make --help` for more information on all potential `make` targets More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html) diff --git a/docs/book/src/cronjob-tutorial/testdata/project/README.md b/docs/book/src/cronjob-tutorial/testdata/project/README.md index a6dd2e20a6..8a221c0137 100644 --- a/docs/book/src/cronjob-tutorial/testdata/project/README.md +++ b/docs/book/src/cronjob-tutorial/testdata/project/README.md @@ -5,73 +5,70 @@ // TODO(user): An in-depth paragraph about your project and overview of use ## Getting Started -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. -**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows). -### Running on the cluster -1. Install Instances of Custom Resources: +### Prerequisites +- go version v1.20.0+ +- docker version 17.03+. +- kubectl version v1.11.3+. +- Access to a Kubernetes v1.11.3+ cluster. -```sh -kubectl apply -k config/samples/ -``` - -2. Build and push your image to the location specified by `IMG`: +### To Deploy on the cluster +**Build and push your image to the location specified by `IMG`:** ```sh make docker-build docker-push IMG=/project:tag ``` -3. Deploy the controller to the cluster with the image specified by `IMG`: +**NOTE:** This image ought to be published in the personal registry you specified. +And it is required to have access to pull the image from the working environment. +Make sure you have the proper permission to the registry if the above commands don’t work. + +**Install the CRDs into the cluster:** ```sh -make deploy IMG=/project:tag +make install ``` -### Uninstall CRDs -To delete the CRDs from the cluster: +**Deploy the Manager to the cluster with the image specified by `IMG`:** ```sh -make uninstall +make deploy IMG=/project:tag ``` -### Undeploy controller -UnDeploy the controller from the cluster: +> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin +privileges or be logged in as admin. + +**Create instances of your solution** +You can apply the samples (examples) from the config/sample: ```sh -make undeploy +kubectl apply -k config/samples/ ``` -## Contributing -// TODO(user): Add detailed information on how you would like others to contribute to this project - -### How it works -This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/). +>**NOTE**: Ensure that the samples has default values to test it out. -It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/), -which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster. - -### Test It Out -1. Install the CRDs into the cluster: +### To Uninstall +**Delete the instances (CRs) from the cluster:** ```sh -make install +kubectl delete -k config/samples/ ``` -2. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running): +**Delete the APIs(CRDs) from the cluster:** ```sh -make run +make uninstall ``` -**NOTE:** You can also run this in one step by running: `make install run` - -### Modifying the API definitions -If you are editing the API definitions, generate the manifests such as CRs or CRDs using: +**UnDeploy the controller from the cluster:** ```sh -make manifests +make undeploy ``` +## Contributing +// TODO(user): Add detailed information on how you would like others to contribute to this project + **NOTE:** Run `make --help` for more information on all potential `make` targets More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html) diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/readme.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/readme.go index 577f5a62a4..7a7d673493 100644 --- a/pkg/plugins/golang/v4/scaffolds/internal/templates/readme.go +++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/readme.go @@ -45,14 +45,13 @@ func (f *Readme) SetTemplateDefaults() error { "*/", "", 1) f.TemplateBody = fmt.Sprintf(readmeFileTemplate, - codeFence("kubectl apply -k config/samples/"), codeFence("make docker-build docker-push IMG=/{{ .ProjectName }}:tag"), + codeFence("make install"), codeFence("make deploy IMG=/{{ .ProjectName }}:tag"), + codeFence("kubectl apply -k config/samples/"), + codeFence("kubectl delete -k config/samples/"), codeFence("make uninstall"), - codeFence("make undeploy"), - codeFence("make install"), - codeFence("make run"), - codeFence("make manifests")) + codeFence("make undeploy")) return nil } @@ -65,57 +64,56 @@ const readmeFileTemplate = `# {{ .ProjectName }} // TODO(user): An in-depth paragraph about your project and overview of use ## Getting Started -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. -**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster ` + "`kubectl cluster-info`" + ` shows). -### Running on the cluster -1. Install Instances of Custom Resources: +### Prerequisites +- go version v1.20.0+ +- docker version 17.03+. +- kubectl version v1.11.3+. +- Access to a Kubernetes v1.11.3+ cluster. -%s - -2. Build and push your image to the location specified by ` + "`IMG`" + `: +### To Deploy on the cluster +**Build and push your image to the location specified by ` + "`IMG`" + `:** %s -3. Deploy the controller to the cluster with the image specified by ` + "`IMG`" + `: - -%s +**NOTE:** This image ought to be published in the personal registry you specified. +And it is required to have access to pull the image from the working environment. +Make sure you have the proper permission to the registry if the above commands don’t work. -### Uninstall CRDs -To delete the CRDs from the cluster: +**Install the CRDs into the cluster:** %s -### Undeploy controller -UnDeploy the controller from the cluster: +**Deploy the Manager to the cluster with the image specified by ` + "`IMG`" + `:** %s -## Contributing -// TODO(user): Add detailed information on how you would like others to contribute to this project +> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin +privileges or be logged in as admin. -### How it works -This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/). +**Create instances of your solution** +You can apply the samples (examples) from the config/sample: + +%s -It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/), -which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster. +>**NOTE**: Ensure that the samples has default values to test it out. -### Test It Out -1. Install the CRDs into the cluster: +### To Uninstall +**Delete the instances (CRs) from the cluster:** %s -2. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running): +**Delete the APIs(CRDs) from the cluster:** %s -**NOTE:** You can also run this in one step by running: ` + "`make install run`" + ` - -### Modifying the API definitions -If you are editing the API definitions, generate the manifests such as CRs or CRDs using: +**UnDeploy the controller from the cluster:** %s +## Contributing +// TODO(user): Add detailed information on how you would like others to contribute to this project + **NOTE:** Run ` + "`make --help`" + ` for more information on all potential ` + "`make`" + ` targets More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html) diff --git a/testdata/project-v4-multigroup/README.md b/testdata/project-v4-multigroup/README.md index 39a1873fad..d89d15c8ed 100644 --- a/testdata/project-v4-multigroup/README.md +++ b/testdata/project-v4-multigroup/README.md @@ -5,73 +5,70 @@ // TODO(user): An in-depth paragraph about your project and overview of use ## Getting Started -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. -**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows). -### Running on the cluster -1. Install Instances of Custom Resources: +### Prerequisites +- go version v1.20.0+ +- docker version 17.03+. +- kubectl version v1.11.3+. +- Access to a Kubernetes v1.11.3+ cluster. -```sh -kubectl apply -k config/samples/ -``` - -2. Build and push your image to the location specified by `IMG`: +### To Deploy on the cluster +**Build and push your image to the location specified by `IMG`:** ```sh make docker-build docker-push IMG=/project-v4-multigroup:tag ``` -3. Deploy the controller to the cluster with the image specified by `IMG`: +**NOTE:** This image ought to be published in the personal registry you specified. +And it is required to have access to pull the image from the working environment. +Make sure you have the proper permission to the registry if the above commands don’t work. + +**Install the CRDs into the cluster:** ```sh -make deploy IMG=/project-v4-multigroup:tag +make install ``` -### Uninstall CRDs -To delete the CRDs from the cluster: +**Deploy the Manager to the cluster with the image specified by `IMG`:** ```sh -make uninstall +make deploy IMG=/project-v4-multigroup:tag ``` -### Undeploy controller -UnDeploy the controller from the cluster: +> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin +privileges or be logged in as admin. + +**Create instances of your solution** +You can apply the samples (examples) from the config/sample: ```sh -make undeploy +kubectl apply -k config/samples/ ``` -## Contributing -// TODO(user): Add detailed information on how you would like others to contribute to this project - -### How it works -This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/). +>**NOTE**: Ensure that the samples has default values to test it out. -It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/), -which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster. - -### Test It Out -1. Install the CRDs into the cluster: +### To Uninstall +**Delete the instances (CRs) from the cluster:** ```sh -make install +kubectl delete -k config/samples/ ``` -2. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running): +**Delete the APIs(CRDs) from the cluster:** ```sh -make run +make uninstall ``` -**NOTE:** You can also run this in one step by running: `make install run` - -### Modifying the API definitions -If you are editing the API definitions, generate the manifests such as CRs or CRDs using: +**UnDeploy the controller from the cluster:** ```sh -make manifests +make undeploy ``` +## Contributing +// TODO(user): Add detailed information on how you would like others to contribute to this project + **NOTE:** Run `make --help` for more information on all potential `make` targets More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html) diff --git a/testdata/project-v4-with-deploy-image/README.md b/testdata/project-v4-with-deploy-image/README.md index 395ffff16b..dff22730ce 100644 --- a/testdata/project-v4-with-deploy-image/README.md +++ b/testdata/project-v4-with-deploy-image/README.md @@ -5,73 +5,70 @@ // TODO(user): An in-depth paragraph about your project and overview of use ## Getting Started -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. -**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows). -### Running on the cluster -1. Install Instances of Custom Resources: +### Prerequisites +- go version v1.20.0+ +- docker version 17.03+. +- kubectl version v1.11.3+. +- Access to a Kubernetes v1.11.3+ cluster. -```sh -kubectl apply -k config/samples/ -``` - -2. Build and push your image to the location specified by `IMG`: +### To Deploy on the cluster +**Build and push your image to the location specified by `IMG`:** ```sh make docker-build docker-push IMG=/project-v4-with-deploy-image:tag ``` -3. Deploy the controller to the cluster with the image specified by `IMG`: +**NOTE:** This image ought to be published in the personal registry you specified. +And it is required to have access to pull the image from the working environment. +Make sure you have the proper permission to the registry if the above commands don’t work. + +**Install the CRDs into the cluster:** ```sh -make deploy IMG=/project-v4-with-deploy-image:tag +make install ``` -### Uninstall CRDs -To delete the CRDs from the cluster: +**Deploy the Manager to the cluster with the image specified by `IMG`:** ```sh -make uninstall +make deploy IMG=/project-v4-with-deploy-image:tag ``` -### Undeploy controller -UnDeploy the controller from the cluster: +> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin +privileges or be logged in as admin. + +**Create instances of your solution** +You can apply the samples (examples) from the config/sample: ```sh -make undeploy +kubectl apply -k config/samples/ ``` -## Contributing -// TODO(user): Add detailed information on how you would like others to contribute to this project - -### How it works -This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/). +>**NOTE**: Ensure that the samples has default values to test it out. -It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/), -which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster. - -### Test It Out -1. Install the CRDs into the cluster: +### To Uninstall +**Delete the instances (CRs) from the cluster:** ```sh -make install +kubectl delete -k config/samples/ ``` -2. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running): +**Delete the APIs(CRDs) from the cluster:** ```sh -make run +make uninstall ``` -**NOTE:** You can also run this in one step by running: `make install run` - -### Modifying the API definitions -If you are editing the API definitions, generate the manifests such as CRs or CRDs using: +**UnDeploy the controller from the cluster:** ```sh -make manifests +make undeploy ``` +## Contributing +// TODO(user): Add detailed information on how you would like others to contribute to this project + **NOTE:** Run `make --help` for more information on all potential `make` targets More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html) diff --git a/testdata/project-v4-with-grafana/README.md b/testdata/project-v4-with-grafana/README.md index 76c83cd34b..ab2df6a57f 100644 --- a/testdata/project-v4-with-grafana/README.md +++ b/testdata/project-v4-with-grafana/README.md @@ -5,73 +5,70 @@ // TODO(user): An in-depth paragraph about your project and overview of use ## Getting Started -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. -**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows). -### Running on the cluster -1. Install Instances of Custom Resources: +### Prerequisites +- go version v1.20.0+ +- docker version 17.03+. +- kubectl version v1.11.3+. +- Access to a Kubernetes v1.11.3+ cluster. -```sh -kubectl apply -k config/samples/ -``` - -2. Build and push your image to the location specified by `IMG`: +### To Deploy on the cluster +**Build and push your image to the location specified by `IMG`:** ```sh make docker-build docker-push IMG=/project-v4-with-grafana:tag ``` -3. Deploy the controller to the cluster with the image specified by `IMG`: +**NOTE:** This image ought to be published in the personal registry you specified. +And it is required to have access to pull the image from the working environment. +Make sure you have the proper permission to the registry if the above commands don’t work. + +**Install the CRDs into the cluster:** ```sh -make deploy IMG=/project-v4-with-grafana:tag +make install ``` -### Uninstall CRDs -To delete the CRDs from the cluster: +**Deploy the Manager to the cluster with the image specified by `IMG`:** ```sh -make uninstall +make deploy IMG=/project-v4-with-grafana:tag ``` -### Undeploy controller -UnDeploy the controller from the cluster: +> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin +privileges or be logged in as admin. + +**Create instances of your solution** +You can apply the samples (examples) from the config/sample: ```sh -make undeploy +kubectl apply -k config/samples/ ``` -## Contributing -// TODO(user): Add detailed information on how you would like others to contribute to this project - -### How it works -This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/). +>**NOTE**: Ensure that the samples has default values to test it out. -It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/), -which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster. - -### Test It Out -1. Install the CRDs into the cluster: +### To Uninstall +**Delete the instances (CRs) from the cluster:** ```sh -make install +kubectl delete -k config/samples/ ``` -2. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running): +**Delete the APIs(CRDs) from the cluster:** ```sh -make run +make uninstall ``` -**NOTE:** You can also run this in one step by running: `make install run` - -### Modifying the API definitions -If you are editing the API definitions, generate the manifests such as CRs or CRDs using: +**UnDeploy the controller from the cluster:** ```sh -make manifests +make undeploy ``` +## Contributing +// TODO(user): Add detailed information on how you would like others to contribute to this project + **NOTE:** Run `make --help` for more information on all potential `make` targets More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html) diff --git a/testdata/project-v4/README.md b/testdata/project-v4/README.md index 215622184f..54e62956d1 100644 --- a/testdata/project-v4/README.md +++ b/testdata/project-v4/README.md @@ -5,73 +5,70 @@ // TODO(user): An in-depth paragraph about your project and overview of use ## Getting Started -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. -**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows). -### Running on the cluster -1. Install Instances of Custom Resources: +### Prerequisites +- go version v1.20.0+ +- docker version 17.03+. +- kubectl version v1.11.3+. +- Access to a Kubernetes v1.11.3+ cluster. -```sh -kubectl apply -k config/samples/ -``` - -2. Build and push your image to the location specified by `IMG`: +### To Deploy on the cluster +**Build and push your image to the location specified by `IMG`:** ```sh make docker-build docker-push IMG=/project-v4:tag ``` -3. Deploy the controller to the cluster with the image specified by `IMG`: +**NOTE:** This image ought to be published in the personal registry you specified. +And it is required to have access to pull the image from the working environment. +Make sure you have the proper permission to the registry if the above commands don’t work. + +**Install the CRDs into the cluster:** ```sh -make deploy IMG=/project-v4:tag +make install ``` -### Uninstall CRDs -To delete the CRDs from the cluster: +**Deploy the Manager to the cluster with the image specified by `IMG`:** ```sh -make uninstall +make deploy IMG=/project-v4:tag ``` -### Undeploy controller -UnDeploy the controller from the cluster: +> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin +privileges or be logged in as admin. + +**Create instances of your solution** +You can apply the samples (examples) from the config/sample: ```sh -make undeploy +kubectl apply -k config/samples/ ``` -## Contributing -// TODO(user): Add detailed information on how you would like others to contribute to this project - -### How it works -This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/). +>**NOTE**: Ensure that the samples has default values to test it out. -It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/), -which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster. - -### Test It Out -1. Install the CRDs into the cluster: +### To Uninstall +**Delete the instances (CRs) from the cluster:** ```sh -make install +kubectl delete -k config/samples/ ``` -2. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running): +**Delete the APIs(CRDs) from the cluster:** ```sh -make run +make uninstall ``` -**NOTE:** You can also run this in one step by running: `make install run` - -### Modifying the API definitions -If you are editing the API definitions, generate the manifests such as CRs or CRDs using: +**UnDeploy the controller from the cluster:** ```sh -make manifests +make undeploy ``` +## Contributing +// TODO(user): Add detailed information on how you would like others to contribute to this project + **NOTE:** Run `make --help` for more information on all potential `make` targets More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html)