Skip to main content

Install Nginx Ingress - From Community

Source - https://github.com/kubernetes/ingress-nginx

resource "helm_release" "ingress" {
depends_on = [null_resource.kubeconfig]
name = "ingress-nginx"
repository = "https://kubernetes.github.io/ingress-nginx"
chart = "ingress-nginx"

values = [
file("${path.module}/ingress.yml")
]

}

For the above one to work, we need to have the ingress.yml file

controller:
service:
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: "nlb"
service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: "true"

To monitor the nginx ingress with prometheus, we need to scrape the metrics. So to scrape metrics thise needs to be exported. Hence we are using metrics to be enabled and giving port information.

controller:
service:
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: "nlb"
service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: "true"
metrics:
enabled: true
podAnnotations:
prometheus.io/port: "10254"
prometheus.io/scrape: "true"