Skip to content

Commit

Permalink
feat: add support for custom labels and annotations on ingress-nginx (#…
Browse files Browse the repository at this point in the history
…2563)

Signed-off-by: Kevin Lefevre <[email protected]>
  • Loading branch information
ArchiFleKs authored Jan 29, 2024
1 parent 8600382 commit 7e501f3
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ repos:
- id: check-merge-conflict
- id: end-of-file-fixer
- repo: https://github.com/renovatebot/pre-commit-hooks
rev: 37.152.1
rev: 37.154.0
hooks:
- id: renovate-config-validator
11 changes: 9 additions & 2 deletions ingress-nginx.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ locals {
linkerd-viz-enabled = false
linkerd-viz-namespace = "linkerd-viz"
allowed_cidrs = ["0.0.0.0/0"]
extra_ns_labels = {}
extra_ns_annotations = {}
},
var.ingress-nginx
)
Expand Down Expand Up @@ -43,10 +45,15 @@ resource "kubernetes_namespace" "ingress-nginx" {
count = local.ingress-nginx["enabled"] ? 1 : 0

metadata {
labels = {
labels = merge({
name = local.ingress-nginx["namespace"]
"${local.labels_prefix}/component" = "ingress"
}
},
local.ingress-nginx["extra_ns_labels"])

annotations = merge(
local.ingress-nginx["extra_ns_annotations"]
)

name = local.ingress-nginx["namespace"]
}
Expand Down
11 changes: 9 additions & 2 deletions modules/aws/ingress-nginx.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ locals {
linkerd-viz-namespace = "linkerd-viz"
ingress_cidrs = ["0.0.0.0/0"]
allowed_cidrs = ["0.0.0.0/0"]
extra_ns_labels = {}
extra_ns_annotations = {}
},
var.ingress-nginx
)
Expand Down Expand Up @@ -134,10 +136,15 @@ resource "kubernetes_namespace" "ingress-nginx" {
count = local.ingress-nginx["enabled"] ? 1 : 0

metadata {
labels = {
labels = merge({
name = local.ingress-nginx["namespace"]
"${local.labels_prefix}/component" = "ingress"
}
},
local.ingress-nginx["extra_ns_labels"])

annotations = merge(
local.ingress-nginx["extra_ns_annotations"]
)

name = local.ingress-nginx["namespace"]
}
Expand Down
11 changes: 9 additions & 2 deletions modules/google/ingress-nginx.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ locals {
default_network_policy = true
ingress_cidrs = ["0.0.0.0/0"]
allowed_cidrs = ["0.0.0.0/0"]
extra_ns_labels = {}
extra_ns_annotations = {}
},
var.ingress-nginx
)
Expand Down Expand Up @@ -71,10 +73,15 @@ resource "kubernetes_namespace" "ingress-nginx" {
count = local.ingress-nginx["enabled"] ? 1 : 0

metadata {
labels = {
labels = merge({
name = local.ingress-nginx["namespace"]
"${local.labels_prefix}/component" = "ingress"
}
},
local.ingress-nginx["extra_ns_labels"])

annotations = merge(
local.ingress-nginx["extra_ns_annotations"]
)

name = local.ingress-nginx["namespace"]
}
Expand Down
11 changes: 9 additions & 2 deletions modules/scaleway/ingress-nginx.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ locals {
linkerd-viz-namespace = "linkerd-viz"
ingress_cidrs = ["0.0.0.0/0"]
allowed_cidrs = ["0.0.0.0/0"]
extra_ns_labels = {}
extra_ns_annotations = {}
},
var.ingress-nginx
)
Expand Down Expand Up @@ -51,10 +53,15 @@ resource "kubernetes_namespace" "ingress-nginx" {
count = local.ingress-nginx["enabled"] ? 1 : 0

metadata {
labels = {
labels = merge({
name = local.ingress-nginx["namespace"]
"${local.labels_prefix}/component" = "ingress"
}
},
local.ingress-nginx["extra_ns_labels"])

annotations = merge(
local.ingress-nginx["extra_ns_annotations"]
)

name = local.ingress-nginx["namespace"]
}
Expand Down

0 comments on commit 7e501f3

Please sign in to comment.