docs / articles / Helm Ingress Template Example

Helm Ingress Template Example

Noah Aug 16, 2026 2026-08-16 04:58:21

Ingress controllers in Kubernetes facilitate external access to your services. Helm, the package manager for Kubernetes, simplifies this process by providing ingress templates. Let's explore a practical example of using a Helm ingress template to expose a simple Kubernetes service to the world.

a spreadsheet showing the number and type of items used to create an invoice sheet
a spreadsheet showing the number and type of items used to create an invoice sheet

Before we dive into the ingress template example, let's briefly recap what an ingress controller does. An ingress controller acts as a load balancer, routing external traffic to the appropriate services within your Kubernetes cluster based on the rules defined in the ingress resources.

a map showing the location of several different streets and areas in which there is no traffic
a map showing the location of several different streets and areas in which there is no traffic

Helm Ingress Template: A Walkthrough

The primary advantage of using a Helm ingress template is its ease of use and the ability to manage complex ingress configurations as code. In this example, we'll use the popular Nginx Ingress controller chart from the official Helmודים repository.

an abstract background with lines and dots in the dark, reflecting light on the ground
an abstract background with lines and dots in the dark, reflecting light on the ground

First, ensure you have the Nginx Ingress Helmándoloorem added to your client:

Adding the Nginx Ingress Repository

four blueprints of helmets on a dark background
four blueprints of helmets on a dark background

To get the Nginx Ingress Helm altository, run the following Helm command:

helm Repository add bitnami https://charts.bitnami.com/bitnami

Now that we've added the Bitnami repository, containing the Nginx Ingress chart, we can proceed to install it.

Installing the Nginx Ingress Controller

the letter b is made up of green letters and an image of a cross on it
the letter b is made up of green letters and an image of a cross on it

The following command installs the Nginx Ingress controller with default configuration:

helm install my-nginx-ingress bitnami/nginx-ingress --set service.type=LoadBalancer

The `-set` flag ensures that the Nginx Ingress service is exposed as a LoadBalancer, enabling direct external access.

Creating an Ingress Resource with Helm

#Ingress
#Ingress

Now that we have the Nginx Ingress controller up and running, let's create an ingress configuration using Helm's template features. We'll create a simple ingress resource to expose a sample Kubernetes service.

First, ensure you have a sample service deployed in your namespace. For this example, let's use the official Kubernetes Guestbook application:

an info sheet showing the different types of helmets for each character in the movie, including one
an info sheet showing the different types of helmets for each character in the movie, including one
#Ingress
#Ingress
Futuristic Gui Background, Sci Fi Id Card Template, Futuristic Tech Overlay, Sci Fi Template, Cyberpunk Hud Interface Elements, Futuristic Hud Light White Frame, Hi-tech Futuristic Hud Interface Design, Futuristic Frame Template, Sci-fi Screen Template
Futuristic Gui Background, Sci Fi Id Card Template, Futuristic Tech Overlay, Sci Fi Template, Cyberpunk Hud Interface Elements, Futuristic Hud Light White Frame, Hi-tech Futuristic Hud Interface Design, Futuristic Frame Template, Sci-fi Screen Template
a blueprinted poster with the words hextends on it
a blueprinted poster with the words hextends on it
an info sheet with numbers and symbols for different types of equipment, including thermometers
an info sheet with numbers and symbols for different types of equipment, including thermometers
Has the Ingress Prime launch just introduced Pay to Win?
Has the Ingress Prime launch just introduced Pay to Win?
Borderlands, Frame Decor, Borders, Poster Design, Frame, Design
Borderlands, Frame Decor, Borders, Poster Design, Frame, Design
Cyberpunk Black Mech Racing Helmet Website UI, F3NARCHDUSYSIC - Digital Assets
Cyberpunk Black Mech Racing Helmet Website UI, F3NARCHDUSYSIC - Digital Assets

Deploying the Kubernetes Guestbook Application

Using Helm, deploy the Guestbook application with the following command:

helm install stable/guestbook --name my-guestbook --set service.type=ClusterIP

This command installs the Guestbook application with a ClusterIP-type service, exposing it internally within your cluster.

Creating a Custom Ingress Template

Create a new file named `ingress.yaml` with the following content to define your custom ingress resource:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: my-ingress
spec:
  rules:
  - host: guestbook.example.com
    http:
      paths:
      - pathType: Prefix
        path: "/"
        backend:
          service:
            name: my-guestbook
            port:
              number: 80

This ingress resource defines a single rule, routing traffic to the `my-guestbook` service when the host header matches `guestbook.example.com`.

To apply this ingress configuration, use the kubectl apply command:

kubectl apply -f ingress.yaml

Now, when you access guestbook.example.com in your web browser, you should see the Guestbook application, thanks to the ingress resource routing traffic to the appropriate service.

Using Helm ingress templates offers significant advantages, primarily the ability to manage complex ingress configurations as code. By leveraging Helm's templating features, you can version-control ingress resources alongside your application code, ensuring predictable and consistent behavior across environments.

That's it! You've successfully deployed a Kubernetes application using Helm, created an ingress resource using a custom template, and exposed it to the external world. Happy automating, and until the next Helm adventure!