Skip to content

Commit

Permalink
Improved docs (newrelic#32)
Browse files Browse the repository at this point in the history
* Improved docs

* Update README.md

* Update README.md

* Update CONTRIBUTING.md

* Update review_guidelines.md

* Update review_guidelines.md

* Update review_guidelines.md

* Fix some doc review comments

* Fix typo

Co-authored-by: Douglas Camata <[email protected]>
  • Loading branch information
theletterf and Douglas Camata authored May 20, 2020
1 parent 18b9f07 commit 6512df3
Show file tree
Hide file tree
Showing 7 changed files with 524 additions and 493 deletions.
26 changes: 0 additions & 26 deletions CHART_TESTING.md

This file was deleted.

84 changes: 22 additions & 62 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,77 +1,37 @@
# Contributing Guidelines
# Contributing

The Kubernetes Charts project accepts contributions via GitHub pull requests. This document outlines the process to help get your contribution accepted.
Contributions are always welcome. Before contributing please read the
[code of conduct](./CODE_OF_CONDUCT.md) and [search the issue tracker](issues); your issue may have already been discussed or fixed in `master`. To contribute, [fork](https://help.github.com/articles/fork-a-repo/) this repository, commit your changes, and [send a Pull Request](https://help.github.com/articles/using-pull-requests/).

Note that [our code of conduct](CODE_OF_CONDUCT.md) applies to all platforms and venues related to this project; please follow it in all your interactions with the project and its participants.
Note that our [code of conduct](./CODE_OF_CONDUCT.md) applies to all platforms and venues related to this project; please follow it in all your interactions with the project and its participants.

## Contributor's License Agreement (CLA)
## Feature requests

To be able to contribute to the New Relic Helm charts repository you have to sign a CLA.
The signature process is handled by a bot and is presented to the contributor as a
check in the pull request. If you didn't sign the CLA yet, follow the procedures in the comment of the bot to do so.
Feature requests should be submitted in the [Issue tracker](../../issues), with a description of the expected behavior & use case, where they’ll remain closed until sufficient interest, [e.g. :+1: reactions](https://help.github.com/articles/about-discussions-in-issues-and-pull-requests/), has been [shown by the community](../../issues?q=label%3A%22votes+needed%22+sort%3Areactions-%2B1-desc).

[The CLA is included in this repository in its full version.](cla.md)
Before submitting an Issue, please search for similar ones in the [closed issues](../../issues?q=is%3Aissue+is%3Aclosed+label%3Aenhancement).

## How to contribute to an existing chart
## Pull requests

1. Fork this repository, develop and test your chart's changes.
1. Ensure your Chart changes follow the [technical](#technical-requirements) and [documentation](#documentation-requirements) guidelines, described below.
1. Submit a pull request.
1. Automated builds will run for testing and linting.
1. A code review will automaticallly be requested by the owners of the chart.
1. The PR is reviewed, merged and the chart is automatically released.
### Requirements

***NOTE***: In order to make testing and merging of PRs easier, please submit changes to multiple charts in separate PRs.
* Check our [review guidelines](REVIEW_GUIDELINES.md).
* Ensure your change adhere to the [technical and documentation requirements](docs/requirements.md).
* Open separate pull requests to submit changes to multiple charts.

### Technical requirements
### Approval and release process

* All Chart dependencies should also be submitted independently
* Must pass the linter (`helm lint`)
* Must successfully launch with default values (`helm install .`)
* All pods go to the running state (or NOTES.txt provides further instructions if a required value is missing).
* All services have at least one endpoint
* Must include source GitHub repositories for images used in the Chart
* Images should not have any major security vulnerabilities
* Must be up-to-date with the latest stable Helm/Kubernetes features
* Use Deployments in favor of ReplicationControllers
* Should follow Kubernetes best practices
* Include Health Checks wherever practical
* Allow configurable [resource requests and limits](http://kubernetes.io/docs/user-guide/compute-resources/#resource-requests-and-limits-of-pod-and-container)
* Provide a method for data persistence (if applicable)
* Support application upgrades
* Allow customization of the application configuration
* Provide a secure default configuration
* Do not leverage alpha features of Kubernetes
* Includes a [NOTES.txt](https://helm.sh/docs/topics/charts/#chart-license-readme-and-notes) explaining how to use the application after install
* Follows [best practices](https://helm.sh/docs/chart_best_practices/)
(especially for [labels](https://helm.sh/docs/chart_best_practices/labels/)
and [values](https://helm.sh/docs/chart_best_practices/values/))
Pull requests approvals go through the following steps:

### Documentation requirements
1. A GitHub action is triggered to lint and test the chart's installation. For more information, see [Chart testing](docs/chart_testing.md).
2. A maintainer [reviews](docs/review_guidelines.md) the changes. Any change requires at least one review.
3. The pull request can be merged when at least one maintainer approves it.

* Must include an in-depth `README.md`, including:
* Short description of the Chart
* Any prerequisites or requirements
* Customization: explaining options in `values.yaml` and their defaults
* Must include a short `NOTES.txt`, including:
* Any relevant post-installation information for the Chart
* Instructions on how to access the application or service provided by the Chart
Once the chart has been merged, it is automatically released.

### Pull request approval and release process
## Contributor License Agreement

A Github Action will run to lint and test the chart's installation. More information abouut it
can be found in the [Chart Testing documentation](CHART_TESTING.md).
Keep in mind that when you submit your pull request, you'll need to sign the [CLA](cla.md) via the click-through using CLA-Assistant. If you'd like to execute our corporate CLA, or if you have any questions, please drop us an email at [email protected].

A maintainer of the chart will review the changes and eventually approve them. Any change requires at least one review.
No pull requests can be merged until at least one maintainer reviews it. A good guide for what to review
can be found in the [Review Guidelines](REVIEW_GUIDELINES.md).

Once the Chart has been merged, the release will be automatically made by a Github Workflwo using the Github Pages of this repository.

## Support Channels

Whether you are a user or contributor, official support channels include:

- GitHub issues: https://github.com/newrelic-experimental/charts/issues

Before opening a new issue or submitting a new pull request, it's helpful to search the project - it's likely that another user has already reported the issue you're facing, or it's a known issue that we're already aware of.
For more information about CLAs, please check out Alex Russell’s excellent post,
[“Why Do I Need to Sign This?”](https://infrequently.org/2008/06/why-do-i-need-to-sign-this/).
118 changes: 69 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,57 @@
[![New Relic Experimental header](https://github.com/newrelic/open-source-office/raw/master/examples/categories/images/Experimental.png)](https://github.com/newrelic/open-source-office/blob/master/examples/categories/index.md#new-relic-experimental)

# New Relic Helm charts repository
# New Relic's Helm charts repository

Official Helm charts for New Relic's products or other charts developed by New Relic.
This is the official Helm charts repository for New Relic. It is indexed at [Helm Hub][helm-hub], where you can find the list of available charts and their documentation.

## Installing charts
<!-- vscode-markdown-toc -->
* [Prerequisites](#Prerequisites)
* [Install](#Installthecharts)
* [Development](#Development)
* [Testing](#Testing)
* [Contributing](#Contributing)
* [Support](#Support)
* [License](#License)

The official New Relic helm charts repository is indexed at
[Helm Hub][helm-hub], there you can find the list of available charts and their
documentation.
<!-- vscode-markdown-toc-config
numbering=true
autoSave=true
/vscode-markdown-toc-config -->
<!-- /vscode-markdown-toc -->

To install the Helm CLI follow the instruction of their [official
documentation][installing-helm].
## <a name='Prerequisites'></a>Prerequisites

To install the New Relic Helm charts, first, you need to add the repository:
* Helm CLI ([install instructions][installing-helm])
* New Relic account

```
## <a name='Installthecharts'></a>Install

To install the New Relic Helm charts, add the official repository first:

```sh
helm repo add newrelic https://helm-charts.newrelic.com
```

You can list all the available charts from the `newrelic` repository with the
[`helm search`][helm-search] command:
You can list all the available charts from the `newrelic` repository using [`helm search`][helm-search]:

```
```sh
helm search repo | grep newrelic/
```

To install one of the charts just run the [`helm install`][helm-install]
command specifying the name of the chart to install and the values you want to
set. You can find a list of all the values and their defaults in the
documentation of each chart.
To install one of the charts, run [`helm install`][helm-install] passing the name of the chart to install and the values you want to set as arguments. You can find a list of all the values and their defaults in the documentation of each chart.

The following example installs the `nri-bundle` chart, which groups multiple
New Relic charts into one. It contains:
### <a name='Examples'></a>Examples

- [The Kubernetes integration][newrelic-kubernetes].
- [Metadata injection webhook][newrelic-webhook].
- [Prometheus OpenMetrics integration][newrelic-prometheus].
- [Kubernetes plugin for logs][newrelic-logs].
- [Kube state metrics][ksm].
The following example installs the `nri-bundle` chart, which groups multiple New Relic charts into one. `nri-bundle` contains:

**Helm 3**
```
- [New Relic's Kubernetes integration][newrelic-kubernetes]
- [New Relic's Kubernetes plugin for logs][newrelic-logs]
- [New Relic's Prometheus OpenMetrics integration][newrelic-prometheus]
- [Metadata injection webhook][newrelic-webhook]
- [Kube state metrics][ksm]

#### <a name='Installnri-bundleusingHelm3'></a>Install `nri-bundle` using Helm 3
```sh
helm install newrelic-bundle newrelic/nri-bundle \
--set global.licenseKey=YOUR_LICENSE_KEY \
--set global.cluster=YOUR_CLUSTER_NAME \
Expand All @@ -52,8 +62,8 @@ helm install newrelic-bundle newrelic/nri-bundle \
--set ksm.enabled=true
```

**Helm 2**
```
#### <a name='Installnri-bundleusingHelm2'></a>Install `nri-bundle` using Helm 2
```sh
helm install newrelic/nri-bundle \
--name newrelic-bundle \
--set global.licenseKey=YOUR_LICENSE_KEY \
Expand All @@ -65,44 +75,54 @@ helm install newrelic/nri-bundle \
--set ksm.enabled=true
```

## Developing a chart

You can use the Helm CLI to develop a chart in this repository.

1. [Install Helm][installing-helm]
1. Add/modify the files for the desired chart
1. Run `helm install dev-chart charts/<YOUR_CHART>` to install it locally.
Feel free to add different values to the chart if you wish so.
1. Verify if the chart works as expected.
1. Remove the installed chart with `helm uninstall dev-chart`.
1. Create your pull request and follow the instructions below.
## <a name='Development'></a>Development

### Contributing
You can use the [Helm CLI][installing-helm] to develop a chart and add it to this repository.

Please view [our contributing docs](CONTRIBUTING.md) for more information.
1. Clone this repository on your local machine.
2. Add or modify the files for the desired chart.
3. To install the chart locally, run `helm install dev-chart charts/<YOUR_CHART>`
4. Verify that the chart works as expected.
5. Remove the installed chart with `helm uninstall dev-chart`.
6. Create your pull request and follow the instructions below.

### Automated version bumps
> Feel free to add different values to the chart.
This repository is configured to accept webhook requests to automatically bump chart versions. If it receives a version bump request, a Github Action will prepare a pull request that contains the requested changes. The PR has to be manually merged after this.
### <a name='Automatedversionbumps'></a>Automated version bumps

#### Trigger an automated version bump
This repository is configured to accept webhook requests to bump chart versions. Upon receiving a version bump request, a GitHub Action generates a pull request with the requested changes. The pull request must still be merged manually.

A repo scoped [GitHub Personal Access Token][github-personal-access-token] is required.
#### <a name='Triggeranautomatedversionbump'></a>Trigger an automated version bump

If you have the Personal Access token, execute the following HTTP POST request:
A [GitHub Personal Access Token][github-personal-access-token] for this repository is required. If you have the token, execute the following POST request (tailor `client_payload` to your needs):

```
```sh
curl -H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token <PERSONAL_ACCESS_TOKEN>" \
--request POST \
--data '{"event_type": "bump-chart-version", "client_payload": { "chart_name": "simple-nginx", "chart_version": "1.2.3", "app_version": "1.45.7"}}' \
https://api.github.com/repos/newrelic-experimental/helm-charts/dispatches
```

Notice the `client_payload` object inside the request body. This specific request will prepare a PR for the `simple-nginx` chart, to update the `app_version` to `1.45.7`, and `chart_version` to `1.2.3`.
Notice the sample `client_payload` object in the request body: the request generates a pull request for the `simple-nginx` chart to update `app_version` to `1.45.7` and `chart_version` to `1.2.3`.

## <a name='Testing'></a>Testing

See [chart testing](docs/chart_testing.md)

## <a name='Contributing'></a>Contributing

See [our Contributing docs](CONTRIBUTING.md) and our [review guidelines](docs/review_guidelines.md)

## <a name='Support'></a>Support

### <a name='IssuesEnhancementRequests'></a>Issues / Enhancement Requests

Issues and enhancement requests can be submitted in the [Issues tab of this repository](../../issues). Please search for and review the existing open issues before submitting a new issue.

You can configure the client_payload accordingly.
## <a name='License'></a>License

The project is released under version 2.0 of the [Apache license](http://www.apache.org/licenses/LICENSE-2.0).

[helm-hub]: https://hub.helm.sh/charts/newrelic
[helm-search]: https://helm.sh/docs/intro/using_helm/#helm-search-finding-charts
Expand Down
Loading

0 comments on commit 6512df3

Please sign in to comment.