DevOps Blog

Installing the Bitnami NGINX Ingress Controller with Helm

In this blog post, I'll walk you through how to install the Bitnami NGINX Ingress Controller using Helm, including how to customize the installation to make it your cluster's default ingress controller.

Prerequisites

Before we begin, make sure you have:

  • A Kubernetes cluster up and running
  • Helm installed and configured
  • kubectl configured to communicate with your cluster

Step 1: Add the Bitnami Helm Repository

First, let's add the Bitnami Helm repository to your Helm configuration:

helm repo add bitnami https://charts.bitnami.com/bitnami helm repo update

Step 2: Fetch the Default Values File

To customize the installation, we'll first fetch the default values file:

helm show values bitnami/nginx-ingress-controller > nginx-values.yaml

This creates a nginx-values.yaml file with all the default configuration options.

Step 3: Modify the Values File

Open the nginx-values.yaml file in your favorite text editor. We'll make several key modifications:

  1. Make it the default ingress controller:
    controller: ingressClassResource: name: nginx enabled: true default: true

Save your changes when you're done customizing.

Step 4: Install the NGINX Ingress Controller

Now we're ready to install using our customized values file:

helm install nginx-ingress bitnami/nginx-ingress-controller \ --namespace ingress-nginx \ --create-namespace \ -f nginx-values.yaml

This command:

  • Creates a new namespace called ingress-nginx
  • Installs the controller with our custom configuration
  • Names the release nginx-ingress

Step 5: Verify the Installation

Check that the pods are running:

kubectl get pods -n ingress-nginx

Verify the ingress class was created and is default:

kubectl get ingressclass

The output should show your ingress class with DEFAULT in the CONTROLLER column.

Step 6: Test with a Sample Application (Optional)

To test that your ingress controller is working properly, you can deploy a sample application:

kubectl create deployment demo --image=nginx --port=80 kubectl expose deployment demo --port=80 kubectl create ingress demo --class=nginx --rule="demo.yourdomain.com/*=demo:80"

Conclusion

You've now successfully installed the Bitnami NGINX Ingress Controller using Helm with custom configuration to make it your cluster's default ingress controller. This setup provides a robust, production-ready ingress solution that can handle routing traffic to your Kubernetes services.

Remember to regularly check for updates to the chart and consider implementing monitoring and alerting for your ingress controller to ensure high availability for your applications.