# Add a new chart in Kubernetes using Helm package manager

> This is the 1st part of a series called ["All about these Helm charts"](https://hashnode.com/series/all-about-these-helm-charts-ck5z2e8im00r889s1cko7gs7f). More articles will follow.


### Wait! What is a Helm chart?

To describe a Kubernetes cluster you have to create a series of configuration files that point to the desired state of this cluster. These files have a very powerful descriptive language but miss a way to follow the [DRY principle](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself) to keep them tidy. For that reason [Helm](https://helm.sh) was introduced as a package manager for Kubernetes. Helm charts are used to generate the actual Kubernetes configuration files and, based on the Go templating engine, can take advantage of variables, conditions, loops and others useful technics. A chart consists of a list of templates that resembles the Kubernetes configuration files, a `values.yaml` that describes the configurable parameters and a `Chart.yaml` that keeps some metadata information, most important one is the version of the chart.

### Adding a new chart

Let's say you found a chart (maybe in [Helm curated charts repo](https://github.com/helm/charts/tree/master/stable)) and you are ready to try it out. What are the next steps?

- Read thoroughly the description and the configurable params in `README.md`.

- If a param is not clear enough, open the [`values.yaml`](https://github.com/helm/charts/blob/master/stable/ambassador/values.yaml) and check for that specific parameter. Most of the times, the writers leave a commented out example of usage.

_For example for `env` variable there is a commented out suggested usage:_
![Screenshot 2020-01-28 at 11.44.57.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1580215408819/qc2h3kuit.png)

- If are you uncertain then look how the specific param is used inside the templates.

_For example: in [`templates/deployment.yaml`](https://github.com/helm/charts/blob/master/stable/ambassador/templates/deployment.yaml#L158) `env` variable is used like this: _

![Screenshot 2020-01-28 at 11.46.08.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1580215474606/D0VydaHhL.png)

- To add the chart to your Helm configuration, edit the `requirements.yaml` file to add the new chart. Remember to add a link to the `Chart.yaml` in the remote repo (eg. Github) to be able to go that chart easily.

![Screenshot 2020-01-28 at 14.26.46.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1580216059880/gRkVdFvSM.png)

- Run `helm dependencies update` (read more for this command [here](https://v2.helm.sh/docs/helm/#helm-dependency-update)) and check the new version in `requirements.lock`.

![Screenshot 2020-01-28 at 14.31.18.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1580216077622/9vP96uYUF.png)

- Make your first test, see if this all works out using the default configuration. Use `helm template` or `helm diff` ((read more for this plugin [here](https://github.com/databus23/helm-diff))) to render the changes in templates, read them, understand why they are needed and what changes you would expect to see.

- Customise the configurable params to your needs and validate again the result using `helm template` or `helm diff`.

> And what if you want a different handling of the templates generated? Do make a [Pull request](https://github.com/firstcontributions/first-contributions)

**And there you have it! You are ready to deploy a shiny new chart to your Kubernetes cluster!**

[![All About That [Upright] Bass - Meghan Trainor Cover PMJ ft. Kate Davis](https://img.youtube.com/vi/iyTTX6Wlf1Y/0.jpg)](https://www.youtube.com/watch?v=iyTTX6Wlf1Y)
