Skip to content

Commit c6d9616

Browse files
committed
Add global configuration variable for NGINX ingress controller
1 parent b32d7ab commit c6d9616

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

ingress_nginx.tf

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,18 @@ data "helm_template" "ingress_nginx" {
9797
}
9898
} : {}
9999
)
100-
config = {
101-
proxy-real-ip-cidr = (
102-
var.ingress_nginx_service_external_traffic_policy == "Local" ?
103-
hcloud_network_subnet.load_balancer.ip_range :
104-
local.node_ipv4_cidr
105-
)
106-
compute-full-forwarded-for = true
107-
use-proxy-protocol = true
108-
}
100+
config = merge(
101+
{
102+
proxy-real-ip-cidr = (
103+
var.ingress_nginx_service_external_traffic_policy == "Local" ?
104+
hcloud_network_subnet.load_balancer.ip_range :
105+
local.node_ipv4_cidr
106+
)
107+
compute-full-forwarded-for = true
108+
use-proxy-protocol = true
109+
},
110+
var.ingress_nginx_config
111+
)
109112
networkPolicy = {
110113
enabled = true
111114
}

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,6 +1122,12 @@ variable "ingress_nginx_service_external_traffic_policy" {
11221122
}
11231123
}
11241124

1125+
variable "ingress_nginx_config" {
1126+
type = any
1127+
default = {}
1128+
description = "Global configuration passed to the ConfigMap consumed by the nginx controller. (Reference: https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/)"
1129+
}
1130+
11251131

11261132
# Ingress Load Balancer
11271133
variable "ingress_load_balancer_type" {

0 commit comments

Comments
 (0)