Skip to main content
The NGINX chart deploys the popular NGINX web server on Kubernetes. NGINX is a high-performance HTTP server, reverse proxy, and IMAP/POP3 proxy server known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.

What It Deploys

This chart deploys:
  • NGINX web server (version 1.16.0)
  • Service for HTTP traffic
  • Optional Ingress or HTTPRoute for external access
  • Optional ServiceMonitor for Prometheus monitoring
  • Optional PrometheusRule for alerting

Installation

helm repo add douban https://douban.github.io/charts/
helm install my-nginx douban/nginx

Key Configuration Parameters

replicaCount
number
default:"1"
Number of NGINX replicas to deploy
image.repository
string
default:"nginx"
NGINX Docker image repository
image.tag
string
default:""
Overrides the image tag (defaults to chart appVersion: 1.16.0)
service.type
string
default:"ClusterIP"
Kubernetes service type (ClusterIP, NodePort, or LoadBalancer)
service.port
number
default:"80"
Service port for HTTP traffic
containerPort
number
default:"80"
Container port NGINX listens on
ingress.enabled
boolean
default:"false"
Enable Ingress resource for external access
httpRoute.enabled
boolean
default:"false"
Enable HTTPRoute resource for Gateway API routing
volumes
array
default:"[]"
Additional volumes to mount (for custom configs or static content)
volumeMounts
array
default:"[]"
Volume mount paths for the NGINX container
env
array
default:"[]"
Environment variables for NGINX container

Example Configurations

Basic Deployment with Ingress

replicaCount: 2

ingress:
  enabled: true
  className: "nginx"
  hosts:
    - host: www.example.com
      paths:
        - path: /
          pathType: Prefix

resources:
  limits:
    cpu: 200m
    memory: 256Mi
  requests:
    cpu: 100m
    memory: 128Mi

Custom Configuration with ConfigMap

volumes:
  - name: nginx-config
    configMap:
      name: my-nginx-config

volumeMounts:
  - name: nginx-config
    mountPath: /etc/nginx/nginx.conf
    subPath: nginx.conf

With Gateway API HTTPRoute

httpRoute:
  enabled: true
  gatewayRef:
    name: envoy-gateway-bundle
    namespace: envoy-gateway-system
  reuseIngressConfiguration: false
  hostnames:
    - www.example.com

Prometheus ServiceMonitor

Enable Prometheus monitoring:
serviceMonitor:
  enabled: true

Prometheus Rules

Enable alerting rules:
prometheusRule:
  enabled: true
  namespace: monitoring
  additionalLabels:
    release: prometheus-operator
  rules:
    - alert: NginxDown
      expr: up{job="nginx"} == 0
      for: 5m
      labels:
        severity: critical
      annotations:
        summary: "NGINX is down"
Enable horizontal pod autoscaling:
autoscaling:
  enabled: true
  minReplicas: 2
  maxReplicas: 10
  targetCPUUtilizationPercentage: 80
  targetMemoryUtilizationPercentage: 80

Build docs developers (and LLMs) love