Skip to main content

NGINX Ingress Controller

Overview

NGINX Ingress Controller is available as an add-on within Ankra's platform, providing external access to services within a Kubernetes cluster. By using NGINX as a reverse proxy and load balancer, it efficiently routes traffic to backend services based on ingress rules.


Configuration Options

The NGINX Ingress Controller add-on offers configurable inputs that allow you to customize the deployment for your specific requirements. Below are the available inputs:

Inputs

  • Helm Chart Version
    This input sets the version of the NGINX Ingress Controller Helm chart to deploy.

    • Default: 4.7.0
    • Options:
      • 4.7.0 (default)

    Example:

    helm_chart_version: "4.7.0"
  • Service Monitor Enabled
    This input allows you to enable or disable the Prometheus service monitor for NGINX Ingress Controller.

    • Default: false
    • Options:
      • true
      • false (default)

    Example:

    service_monitor_enabled: "false"
  • Controller Service Type
    This input specifies the service type for NGINX Ingress Controller.

    • Default: NodePort
    • Options:
      • LoadBalancer
      • NodePort (default)

    Example:

    controller_service_type: "NodePort"

Usage

Deploying NGINX Ingress Controller

To deploy NGINX Ingress Controller in your Kubernetes cluster using Ankra, follow these steps:

  1. Access the Add-ons Section
    In Ankra's platform, navigate to the Add-ons section and select NGINX Ingress Controller from the list of available add-ons.

  2. Configure Inputs
    You will be prompted to configure the following inputs:

    • Helm Chart Version: Set the version of the NGINX Ingress Controller Helm chart.
    • Service Monitor Enabled: Optionally enable the Prometheus service monitor.
    • Controller Service Type: Define the service type (LoadBalancer or NodePort).

    Example configuration:

    helm_chart_version: "4.7.0"
    service_monitor_enabled: "false"
    controller_service_type: "NodePort"
  3. How to use Nginx Ingress

    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
    name: example-ingress
    namespace: default
    annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
    nginx.ingress.kubernetes.io/ssl-redirect: "true" # Redirect HTTP to HTTPS
    spec:
    ingressClassName: nginx # References the custom IngressClass for NGINX
    tls:
    - hosts:
    - example.com
    secretName: example-tls # TLS secret for the certificate
    rules:
    - host: example.com
    http:
    paths:
    - path: /
    pathType: Prefix
    backend:
    service:
    name: example-service
    port:
    number: 80