Skip to content

Commit

Permalink
fix: sync ingress-nginx version and labels
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Lefevre <[email protected]>
  • Loading branch information
ArchiFleKs committed Nov 8, 2020
1 parent f9ed868 commit 7f3d1b9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
11 changes: 4 additions & 7 deletions ingress-nginx.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ locals {
namespace = "ingress-nginx"
chart = "ingress-nginx"
repository = "https://kubernetes.github.io/ingress-nginx"
use_nlb = false
use_l7 = false
enabled = false
default_network_policy = true
ingress_cidrs = ["0.0.0.0/0"]
Expand All @@ -34,10 +32,9 @@ controller:
enabled: true
priorityClassName: ${local.priority-class-ds["create"] ? kubernetes_priority_class.kubernetes_addons_ds[0].metadata[0].name : ""}
podSecurityPolicy:
enabled: true
enabled: false
VALUES


}

resource "kubernetes_namespace" "ingress-nginx" {
Expand Down Expand Up @@ -145,11 +142,11 @@ resource "kubernetes_network_policy" "ingress-nginx_allow_ingress" {

ingress {
ports {
port = "80"
port = "http"
protocol = "TCP"
}
ports {
port = "443"
port = "https"
protocol = "TCP"
}

Expand Down Expand Up @@ -217,7 +214,7 @@ resource "kubernetes_network_policy" "ingress-nginx_allow_control_plane" {

ingress {
ports {
port = "8443"
port = "webhook"
protocol = "TCP"
}

Expand Down
25 changes: 14 additions & 11 deletions modules/scaleway/ingress-nginx.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ locals {
repository = "https://kubernetes.github.io/ingress-nginx"
enabled = false
default_network_policy = true
ingress_cidr = "0.0.0.0/0"
chart_version = "2.15.0"
version = "0.35.0"
ingress_cidrs = ["0.0.0.0/0"]
chart_version = "3.8.0"
version = "0.41.0"
allowed_cidrs = ["0.0.0.0/0"]
},
var.ingress-nginx
Expand Down Expand Up @@ -148,17 +148,20 @@ resource "kubernetes_network_policy" "ingress-nginx_allow_ingress" {

ingress {
ports {
port = "80"
port = "http"
protocol = "TCP"
}
ports {
port = "443"
port = "https"
protocol = "TCP"
}

from {
ip_block {
cidr = local.ingress-nginx["ingress_cidr"]
dynamic "from" {
for_each = local.ingress-nginx["ingress_cidrs"]
content {
ip_block {
cidr = from.value
}
}
}
}
Expand All @@ -168,7 +171,7 @@ resource "kubernetes_network_policy" "ingress-nginx_allow_ingress" {
}

resource "kubernetes_network_policy" "ingress-nginx_allow_monitoring" {
count = local.ingress-nginx["enabled"] && local.ingress-nginx["default_network_policy"] && local.kube-prometheus-stack["enabled"] ? 1 : 0
count = local.ingress-nginx["enabled"] && local.ingress-nginx["default_network_policy"] ? 1 : 0

metadata {
name = "${kubernetes_namespace.ingress-nginx.*.metadata.0.name[count.index]}-allow-monitoring"
Expand All @@ -188,7 +191,7 @@ resource "kubernetes_network_policy" "ingress-nginx_allow_monitoring" {
from {
namespace_selector {
match_labels = {
name = kubernetes_namespace.kube-prometheus-stack.*.metadata.0.name[count.index]
"${local.labels_prefix}/component" = "monitoring"
}
}
}
Expand Down Expand Up @@ -217,7 +220,7 @@ resource "kubernetes_network_policy" "ingress-nginx_allow_control_plane" {

ingress {
ports {
port = "8443"
port = "webhook"
protocol = "TCP"
}

Expand Down

0 comments on commit 7f3d1b9

Please sign in to comment.