Skip to main content
Version: 3.9.0

Install NGINX Ingress Controller

Inspect the prerequisites and the main steps to perform for installing Install NGINX Ingress Controller on Kubernetes.

Prerequisites​

Installation​

To install the ingress-nginx chart, follow the steps below:

  1. Create an ingress-nginx namespace:

    kubectl create namespace ingress-nginx
  2. Add a chart repository:

    helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
    helm repo update
  3. Install the ingress-nginx chart:

    helm install ingress ingress-nginx/ingress-nginx \
    --version 4.7.0 \
    --values values.yaml \
    --namespace ingress-nginx

    Check out the values.yaml file sample of the ingress-nginx chart customization:

View: values.yaml
controller:
addHeaders:
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
resources:
limits:
memory: "256Mi"
requests:
cpu: "50m"
memory: "128M"
config:
ssl-redirect: 'true'
client-header-buffer-size: '64k'
http2-max-field-size: '64k'
http2-max-header-size: '64k'
large-client-header-buffers: '4 64k'
upstream-keepalive-timeout: '120'
keep-alive: '10'
use-forwarded-headers: 'true'
proxy-real-ip-cidr: '172.32.0.0/16'
proxy-buffer-size: '8k'

# To watch Ingress objects without the ingressClassName field set parameter value to true.
# https://kubernetes.github.io/ingress-nginx/#i-have-only-one-ingress-controller-in-my-cluster-what-should-i-do
watchIngressWithoutClass: true

service:
type: NodePort
nodePorts:
http: 32080
https: 32443
updateStrategy:
rollingUpdate:
maxUnavailable: 1
type: RollingUpdate
metrics:
enabled: true
defaultBackend:
enabled: true
serviceAccount:
create: true
name: nginx-ingress-service-account
info

Align value controller.config.proxy-real-ip-cidr with your network settings.

note

It is also possible to install the ingress controller via cluster add-ons. For details, please refer to the Install via Add-Ons page.