fix
This commit is contained in:
@@ -1,77 +0,0 @@
|
||||
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
|
||||
}
|
||||
pvc_spec = merge({
|
||||
"accessModes" = [var.storage.volume.accessMode]
|
||||
"volumeMode" = var.storage.volume.type
|
||||
"resources" = {
|
||||
"requests" = {
|
||||
"storage" = "${var.storage.volume.size}"
|
||||
}
|
||||
}
|
||||
}, var.storage.volume.class != "" ?{
|
||||
"storageClassName" = var.storage.volume.class
|
||||
}:{})
|
||||
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/loki"
|
||||
new_name = "${var.images.loki.registry}/${var.images.loki.repository}"
|
||||
new_tag = "${var.images.loki.tag}"
|
||||
}
|
||||
patches {
|
||||
target {
|
||||
kind = "ServiceMonitor"
|
||||
name = "loki"
|
||||
}
|
||||
patch = <<-EOF
|
||||
- op: replace
|
||||
path: /spec/endpoints/0/relabelings/0/replacement
|
||||
value: "${var.namespace}/$1"
|
||||
EOF
|
||||
}
|
||||
patches {
|
||||
target {
|
||||
kind = "StatefulSet"
|
||||
name = "loki"
|
||||
}
|
||||
patch = <<-EOF
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: loki
|
||||
spec:
|
||||
replicas: 1
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: loki
|
||||
imagePullPolicy: ${var.images.loki.pullPolicy}
|
||||
volumeClaimTemplates:
|
||||
- apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: storage
|
||||
annotations:
|
||||
k8up.io/backup: "true"
|
||||
spec: ${jsonencode(local.pvc_spec)}
|
||||
EOF
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user