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
Number of NGINX replicas to deploy
NGINX Docker image repository
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 for HTTP traffic
Container port NGINX listens on
Enable Ingress resource for external access
Enable HTTPRoute resource for Gateway API routing
Additional volumes to mount (for custom configs or static content)
Volume mount paths for the NGINX container
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
Links