add monitoring to ingress nginx controller [ci skip]

This commit is contained in:
Viktor Barzin 2024-12-31 15:07:32 +00:00
parent 8e1e1a963c
commit d15e8284a8

View file

@ -436,7 +436,7 @@ resource "kubernetes_deployment" "ingress_nginx_controller" {
} }
} }
spec { spec {
replicas = 3 replicas = 1
selector { selector {
match_labels = { match_labels = {
@ -456,6 +456,9 @@ resource "kubernetes_deployment" "ingress_nginx_controller" {
"app" = "ingress-nginx" "app" = "ingress-nginx"
} }
annotations = { annotations = {
"prometheus.io/scrape" = "true"
"prometheus.io/port" = 10254
"diun.enable" = "true" "diun.enable" = "true"
"diun.include_tags" = "^v\\d+(?:\\.\\d+)?(?:\\.\\d+)?.*$" "diun.include_tags" = "^v\\d+(?:\\.\\d+)?(?:\\.\\d+)?.*$"
} }
@ -570,6 +573,11 @@ resource "kubernetes_deployment" "ingress_nginx_controller" {
container_port = 8443 container_port = 8443
protocol = "TCP" protocol = "TCP"
} }
port {
name = "metrics"
container_port = 10254
protocol = "TCP"
}
env { env {
name = "POD_NAME" name = "POD_NAME"
value_from { value_from {