39 lines
1.2 KiB
HCL
39 lines
1.2 KiB
HCL
locals {
|
|
common_labels = {
|
|
"vynil.solidite.fr/owner-name" = var.instance
|
|
"vynil.solidite.fr/owner-namespace" = var.namespace
|
|
"vynil.solidite.fr/owner-category" = var.category
|
|
"vynil.solidite.fr/owner-component" = var.component
|
|
"app.kubernetes.io/managed-by" = "vynil"
|
|
"app.kubernetes.io/instance" = var.instance
|
|
}
|
|
rb-patch = <<-EOF
|
|
- op: replace
|
|
path: /subjects/0/namespace
|
|
value: "${var.namespace}"
|
|
EOF
|
|
}
|
|
|
|
data "kustomization_overlay" "data" {
|
|
common_labels = local.common_labels
|
|
namespace = var.namespace
|
|
resources = [for file in fileset(path.module, "*.yaml"): file if file != "index.yaml" && length(regexall("ClusterRole",file))<1]
|
|
images {
|
|
name = "docker.io/grafana/promtail"
|
|
new_name = "${var.images.promtail.registry}/${var.images.promtail.repository}"
|
|
new_tag = "${var.images.promtail.tag}"
|
|
}
|
|
}
|
|
data "kustomization_overlay" "data_no_ns" {
|
|
common_labels = local.common_labels
|
|
resources = [for file in fileset(path.module, "*.yaml"): file if length(regexall("ClusterRole",file))>0]
|
|
|
|
patches {
|
|
target {
|
|
kind = "ClusterRoleBinding"
|
|
name = "promtail"
|
|
}
|
|
patch = local.rb-patch
|
|
}
|
|
}
|