fix
This commit is contained in:
68
monitor/grafana/datas.tf
Normal file
68
monitor/grafana/datas.tf
Normal file
@@ -0,0 +1,68 @@
|
||||
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/grafana"
|
||||
new_name = "${var.images.grafana.registry}/${var.images.grafana.repository}"
|
||||
new_tag = "${var.images.grafana.tag}"
|
||||
}
|
||||
images {
|
||||
name = "docker.io/library/busybox"
|
||||
new_name = "${var.images.busybox.registry}/${var.images.busybox.repository}"
|
||||
new_tag = "${var.images.busybox.tag}"
|
||||
}
|
||||
images {
|
||||
name = "quay.io/kiwigrid/k8s-sidecar"
|
||||
new_name = "${var.images.sidecar.registry}/${var.images.sidecar.repository}"
|
||||
new_tag = "${var.images.sidecar.tag}"
|
||||
}
|
||||
patches {
|
||||
target {
|
||||
kind = "PersistentVolumeClaim"
|
||||
name = "grafana"
|
||||
}
|
||||
patch = <<-EOF
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: grafana
|
||||
annotations:
|
||||
k8up.io/backup: "true"
|
||||
spec:
|
||||
accessModes:
|
||||
- "${var.volume.accessMode}"
|
||||
volumeMode: Filesystem
|
||||
resources:
|
||||
requests:
|
||||
storage: "${var.volume.size}"
|
||||
EOF
|
||||
}
|
||||
patches {
|
||||
target {
|
||||
kind = "ServiceMonitor"
|
||||
name = "grafana"
|
||||
}
|
||||
patch = <<-EOF
|
||||
- op: replace
|
||||
path: /spec/endpoints/0/relabelings/0/replacement
|
||||
value: "${var.namespace}/$1"
|
||||
EOF
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user