Helm Chart
A helm chart is a helm package combining kubernetes resource files templates and their values. Following are the contents of a helm chart or a helm package.
Chart.yaml
- templates
values.yaml
- Other files
Chart.yaml
contains information about the package. A sample chart.yaml
can be like following.
apiVersion: v1
name: Smriti
version: 0.1.0
description: Smriti helm chart
home: https://smriti.com
sources:
- https://github.com/smriti
maintainers:
- email: nitin@gmail.com
name: Nitin
Templates are kubernetes resource files with custom values as placeholders. These values will then be populated by helm using values.yaml
file.
templates/pod.yaml
kind: Pod
apiVersion: v1
metadata:
name: {{ .Values.pod_name }}
spec:
containers:
- name: {{ .Values.pod_container_name }}
image: {{ .Values.pod_image }}
Corresponding values file can be,
values.yaml
pod_name: "nginx-pod"
pod_image: "nginx"
pod_container_name: "nginx-container"
Charts Repo
There is helm chart repository where people publish their charts. We can also list those charts using command,
helm search hub wordpress
We can also add custom repo to helm using command
helm repo add <repo-name> <repo-url>
Now we can search in custom repo using command,
helm search repo <chart-name>