Exploring the vast landscape of Kubernetes, you might have come across Helm, a powerful package manager that streamlines application deployment. Helm packages are known as charts, and understanding how to create and manage these charts is a vital skill for any Kubernetes user. Today, we're diving into a practical example of a Helm template, using GitHub as our platform. Let's get started!

For this example, we'll create a simple Node.js application and package it as a Helm chart. This will allow us to understand the fundamentals of Helm templates and GitHub integration. Before we begin, ensure you have Helm installed and your Kubernetes cluster up and running.

Setting Up the GitHub Repository
First, let's set up a GitHub repository to host our Helm chart. This will allow us to track changes, collaborate with others, and easily deploy our application to multiple environments.

The repository structure should resemble the following:
```markdown helm-charts/ └── my-node-app/ ├── Chart.yaml ├── values.yaml ├── templates/ │ ├── deployment.yaml │ ├── service.yaml │ └── ... └── ... ```
Chart.yaml and values.yaml

Create a `Chart.yaml` file containing metatags like chart name, version, and description. The `values.yaml` file will hold the default configurations for your application.
Next, we'll dive into the templates, which are the heart of Helm charts. The templates in the `templates/` directory define the actual Kubernetes manifests that will be rendered and deployed.
Deployment and Service Templates

The `deployment.yaml` template defines how our Node.js application will be deployed. It includes specfications like the container image, port, and resource limits. Here's a basic example:
```yaml apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "my-node-app.fullname" . }} spec: selector: matchLabels: app.kubernetes.io/name: {{ include "my-node-app.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} template: metadata: labels: app.kubernetes.io/name: {{ include "my-node-app.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} spec: containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" ports: - name: http containerPort: 3000 protocol: TCP ```
The `service.yaml` template, on the other hand, defines how our application will be exposed to the world. It includes specifications like the service type, ports, and selectors.
Installing the Chart Locally and on Kubernetes

Now that we have our Helm chart set up, let's test it locally and deploy it to our Kubernetes cluster.
First, add your chart repository to Helm:








```bash
helm repo add my-repo https://github.com/ Then, install the chart locally:
```bash
helm install Once successfully installed, you can verify the deployment and service with:
```bash kubectl get deployments kubectl get services ```
If everything looks good, you can deploy the chart to your Kubernetes cluster using the same command:
```bash
helm install The final step is to verify the application is running and accessible. This example demonstrates the power and flexibility of Helm templates, enabling you to package and manage complex applications with ease. Happy charting!