Install an Ingress Controller

The MATRIXX cloud native reference configuration uses the nginx ingress controller. Other ingress controllers such as Ambassador or ALB ingress controller on EKS can be used in production clusters.

Before you begin

The nginx ingress controller documentation covers configuration scenarios for most public Kubernetes clusters. There are additional considerations including configuring a LoadBalancer resource.

About this task

In a single-node deployment, enable the host network option along with the ClusterFirstWithHostNet dnsPolicy. This is a simple scenario that does not rely on a load balancer. The following nginx_values.yaml file excerpt shows this configuration.
# custom values for a single-node deployment
controller:
  hostNetwork: true
  dnsPolicy: ClusterFirstWithHostNet
  reportNodeInternalIp: true
  kind: DaemonSet
  publishService:
    enabled: false
  extraArgs:
    publish-status-address: 127.0.0.1

The following metrics configuration values can be specified for both single-node or production systems, either in the nginx_values.yaml file or a separate metrics.yaml file.

  metrics: 
    # enable metrics if prometheus is also installed
    enabled: false
    serviceMonitor: 
      enabled: true
      honorLabels: true

The full nginx ingress controller Helm values file includes many other options that might be required in production deployments.

Procedure

  1. Add the nginx ingress controller helm chart repository with the following command:
    helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
  2. Install nginx ingress controller with the following command:
    helm install mtx ingress-nginx/ingress-nginx -f nginx_values.yaml -n kube-system

What to do next

In production deployments, an external hardware load balancer is used. If the nginx controller needs a static IP address for the load balancer service, the following additional Helm values are required, where your_static_IP is the static IP to assign to the load balancer:
controller:
  service:
    loadBalancerIP: your_static_IP

If the YAML lines above are in a file named static_ip.yaml, you can apply the Helm values with the following commands:

helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm install nginx ingress-nginx/ingress-nginx -n kube-system -f static_ip.yaml
To also apply nginx_values.yaml, specify each file with a separate -f option:
helm install nginx ingress-nginx/ingress-nginx -n kube-system -f nginx_values.yaml -f static_ip.yaml

For more information, see documentation from your Kubernetes cluster provider.