What are Helm charts
Helm is a tool for managing Kubernetes charts. Helm charts are packages of pre-configured Kubernetes resources.
What are the community charts
Helm community charts are curated applications for Kubernetes. They are a set of charts that is maintained by the helm community and reviewed for integrity. Many common applications and Kubernetes components are available through the charts repo such as nginx-ingress, jenkins, sonarqube, and many more.
Where are the community charts
The community charts can be found at https://github.com/helm/charts. They recently moved from the Kubernetes organization. You can also browse all the community charts on https://hub.kubeapps.com.
How to contribute
Step 1: Find a problem
Find an open-sourced application without a chart or find a chart that needs some work. There are always lots of open issues: https://git.io/vpKLH.
Step 2: Solve the problem
Once you have identified the application you are creating a chart for, let’s create the basic plumbing for the chart. The following steps will give a basic chart for you to modify for the application :
- Fork the charts repo: https://github.com/helm/charts
- Clone your forked repo
- Install helm locally: https://docs.helm.sh/using_helm/#installing-helm
- From the charts/stable directory:
- helm create my-new-chart
- Modify the chart to deploy your application of choice. Most of the values can be left default. Common changes are as follows:
- In the my-new-chart/values.yaml
- image.repository
- image.tag
- Service.port
- In my-new-chart/Chart.yaml
- All fields should be updated to reflect the app being deployed
- In my-new-chart/templates/deployment
- spec.template.spec.containers.ports.containerPort
- spec.template.spec.containers.livenessProbe.httpGet.path
- spec.template.spec.containers.readinessProbe.httpGet.path
- Add a Readme.md
- This should explain how to install the chart and what overrides are available.
- Here is a good example of a chart Readme: https://git.io/fAnFh
- In the my-new-chart/values.yaml
- Test your chart (All commands from the charts directory)
- Lint the chart to ensure you have the basic formatting:
- helm lint stable/my-new-chart
- Do a dry run to see if the template compiles
- helm install –debug –dry-run stable/my-new-chart
- Finally, if you have a kubernetes cluster with helm initialized (I usually use minikube ):
- helm install stable/my-new-chart
- Lint the chart to ensure you have the basic formatting:
Now that you have the basic chart running, you can add secrets, persistent volume claims, etc. See “Tips and Tricks” (below) for helm templates on the various kubernetes components.
Step 3: Contribute to the Charts repo
- Ensure to sign your commits: https://www.helm.sh/blog/helm-dco/index.html
- Create the pull request
- Be responsive to comments and change requests. Pull requests are much quicker when comments and concerns are responded to quickly.
- In the pull request, pay close attention to the block below. The details links on the right will show you why something has failed. No pull request can be merged until all tests are passing.
Step 4: Keep contributing
If you find a bug, try and fix it. If there isn’t a chart for your open sourced tool, create one. If you find yourself contributing frequently, reach out to one of the maintainer’s to see how you can help.
Tips and Tricks
Community Charts resources
There are a lot of great resources to look through when working on a chart:
- The charts repo: https://github.com/helm/charts
- Look through the charts. There are lots of examples of how to template the different Kubernetes resources.
- Contribution guidelines: https://git.io/vpKtC
- Review guidelines: https://git.io/vpKtg
- Helm docs: https://docs.helm.sh/chart_template_guide/
Other resources:
- Kubernetes.io –
- At the end of the day, helm is just a templating engine on top of Kubernetes
- Sprig: https://github.com/Masterminds/sprig
- Helm uses go templates and sprig within the charts
Finally, if you get stuck, reach out on the #charts channel on http://slack.k8s.io/
Wrap up
The helm community charts are a great place to get familiar with helm. Find a feature that doesn’t exist or a chart that needs some work and contribute back. Be patient with the review process, it is all community driven and can take time. A tool is only as good as the community around it, and helm has a pretty great community.