fix
This commit is contained in:
@@ -14,8 +14,11 @@ locals {
|
||||
"backups" = var.backups
|
||||
"app-group" = var.app-group
|
||||
}
|
||||
grafana = { for k, v in var.grafana : k => v if k!="enable" }
|
||||
prometheus = { for k, v in var.prometheus : k => v if k!="enable" }
|
||||
alertmanager = { for k, v in var.alertmanager : k => v if k!="enable" }
|
||||
loki = { for k, v in var.loki : k => v if k!="enable" }
|
||||
promtail = { for k, v in var.promtail : k => v if k!="enable" }
|
||||
alerts-core = { for k, v in var.alerts-core : k => v if k!="enable" }
|
||||
alerts-containers = { for k, v in var.alerts-containers : k => v if k!="enable" }
|
||||
nodeExporter = { for k, v in var.node-exporter : k => v if k!="enable" }
|
||||
@@ -28,7 +31,7 @@ locals {
|
||||
}
|
||||
|
||||
resource "kubernetes_namespace_v1" "monitor-ns" {
|
||||
count = ( var.prometheus.enable || var.alertmanager.enable || var.node-exporter.enable || var.kube-state-metrics.enable || var.monitor-control-plan.enable )? 1 : 0
|
||||
count = ( var.grafana.enable || var.loki.enable || var.promtail.enable || var.prometheus.enable || var.alertmanager.enable || var.node-exporter.enable || var.kube-state-metrics.enable || var.monitor-control-plan.enable )? 1 : 0
|
||||
metadata {
|
||||
annotations = local.annotations
|
||||
labels = merge(local.common-labels, local.annotations)
|
||||
@@ -223,3 +226,54 @@ resource "kubectl_manifest" "dashboards-workload" {
|
||||
options: ${jsonencode(merge(local.global, local.dashboards-workload))}
|
||||
EOF
|
||||
}
|
||||
|
||||
resource "kubectl_manifest" "grafana" {
|
||||
count = var.grafana.enable ? 1 : 0
|
||||
yaml_body = <<-EOF
|
||||
apiVersion: "vynil.solidite.fr/v1"
|
||||
kind: "Install"
|
||||
metadata:
|
||||
name: "grafana"
|
||||
namespace: "${kubernetes_namespace_v1.monitor-ns[0].metadata[0].name}"
|
||||
labels: ${jsonencode(local.common-labels)}
|
||||
spec:
|
||||
distrib: "${var.distributions.domain}"
|
||||
category: "monitor"
|
||||
component: "grafana"
|
||||
options: ${jsonencode(merge(local.global, local.grafana))}
|
||||
EOF
|
||||
}
|
||||
|
||||
resource "kubectl_manifest" "promtail" {
|
||||
count = var.promtail.enable ? 1 : 0
|
||||
yaml_body = <<-EOF
|
||||
apiVersion: "vynil.solidite.fr/v1"
|
||||
kind: "Install"
|
||||
metadata:
|
||||
name: "promtail"
|
||||
namespace: "${kubernetes_namespace_v1.monitor-ns[0].metadata[0].name}"
|
||||
labels: ${jsonencode(local.common-labels)}
|
||||
spec:
|
||||
distrib: "${var.distributions.domain}"
|
||||
category: "monitor"
|
||||
component: "promtail"
|
||||
options: ${jsonencode(merge(local.global, local.promtail))}
|
||||
EOF
|
||||
}
|
||||
|
||||
resource "kubectl_manifest" "loki" {
|
||||
count = var.loki.enable ? 1 : 0
|
||||
yaml_body = <<-EOF
|
||||
apiVersion: "vynil.solidite.fr/v1"
|
||||
kind: "Install"
|
||||
metadata:
|
||||
name: "loki"
|
||||
namespace: "${kubernetes_namespace_v1.monitor-ns[0].metadata[0].name}"
|
||||
labels: ${jsonencode(local.common-labels)}
|
||||
spec:
|
||||
distrib: "${var.distributions.domain}"
|
||||
category: "monitor"
|
||||
component: "loki"
|
||||
options: ${jsonencode(merge(local.global, local.loki))}
|
||||
EOF
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ metadata:
|
||||
name: domain-monitor
|
||||
description: null
|
||||
options:
|
||||
alerts-containers:
|
||||
dashboards-namespace:
|
||||
default:
|
||||
enable: true
|
||||
examples:
|
||||
@@ -17,7 +17,7 @@ options:
|
||||
type: boolean
|
||||
type: object
|
||||
x-vynil-category: monitor
|
||||
x-vynil-package: alerts-containers
|
||||
x-vynil-package: dashboards-namespace
|
||||
backups:
|
||||
default:
|
||||
enable: false
|
||||
@@ -48,108 +48,6 @@ options:
|
||||
default: backup-settings
|
||||
type: string
|
||||
type: object
|
||||
monitor-control-plan:
|
||||
default:
|
||||
enable: false
|
||||
examples:
|
||||
- enable: false
|
||||
properties:
|
||||
enable:
|
||||
default: false
|
||||
type: boolean
|
||||
type: object
|
||||
x-vynil-category: monitor
|
||||
x-vynil-package: monitor-control-plan
|
||||
kube-state-metrics:
|
||||
default:
|
||||
enable: true
|
||||
examples:
|
||||
- enable: true
|
||||
properties:
|
||||
enable:
|
||||
default: true
|
||||
type: boolean
|
||||
type: object
|
||||
x-vynil-category: monitor
|
||||
x-vynil-package: kube-state-metrics
|
||||
ingress-class:
|
||||
default: traefik
|
||||
examples:
|
||||
- traefik
|
||||
type: string
|
||||
domain:
|
||||
default: your-company
|
||||
examples:
|
||||
- your-company
|
||||
type: string
|
||||
dashboards-namespace:
|
||||
default:
|
||||
enable: true
|
||||
examples:
|
||||
- enable: true
|
||||
properties:
|
||||
enable:
|
||||
default: true
|
||||
type: boolean
|
||||
type: object
|
||||
x-vynil-category: monitor
|
||||
x-vynil-package: dashboards-namespace
|
||||
domain-name:
|
||||
default: your_company.com
|
||||
examples:
|
||||
- your_company.com
|
||||
type: string
|
||||
dashboards-cluster:
|
||||
default:
|
||||
enable: true
|
||||
examples:
|
||||
- enable: true
|
||||
properties:
|
||||
enable:
|
||||
default: true
|
||||
type: boolean
|
||||
type: object
|
||||
x-vynil-category: monitor
|
||||
x-vynil-package: dashboards-cluster
|
||||
dashboards-workload:
|
||||
default:
|
||||
enable: true
|
||||
examples:
|
||||
- enable: true
|
||||
properties:
|
||||
enable:
|
||||
default: true
|
||||
type: boolean
|
||||
type: object
|
||||
x-vynil-category: monitor
|
||||
x-vynil-package: dashboards-workload
|
||||
prometheus:
|
||||
default:
|
||||
enable: true
|
||||
examples:
|
||||
- enable: true
|
||||
properties:
|
||||
enable:
|
||||
default: true
|
||||
type: boolean
|
||||
type: object
|
||||
x-vynil-category: monitor
|
||||
x-vynil-package: prometheus
|
||||
distributions:
|
||||
default:
|
||||
core: core
|
||||
domain: domain
|
||||
examples:
|
||||
- core: core
|
||||
domain: domain
|
||||
properties:
|
||||
core:
|
||||
default: core
|
||||
type: string
|
||||
domain:
|
||||
default: domain
|
||||
type: string
|
||||
type: object
|
||||
alertmanager:
|
||||
default:
|
||||
enable: true
|
||||
@@ -162,40 +60,35 @@ options:
|
||||
type: object
|
||||
x-vynil-category: monitor
|
||||
x-vynil-package: alertmanager
|
||||
loki:
|
||||
default:
|
||||
enable: true
|
||||
examples:
|
||||
- enable: true
|
||||
properties:
|
||||
enable:
|
||||
default: true
|
||||
type: boolean
|
||||
type: object
|
||||
x-vynil-category: monitor
|
||||
x-vynil-package: loki
|
||||
dashboards-workload:
|
||||
default:
|
||||
enable: true
|
||||
examples:
|
||||
- enable: true
|
||||
properties:
|
||||
enable:
|
||||
default: true
|
||||
type: boolean
|
||||
type: object
|
||||
x-vynil-category: monitor
|
||||
x-vynil-package: dashboards-workload
|
||||
issuer:
|
||||
default: letsencrypt-prod
|
||||
examples:
|
||||
- letsencrypt-prod
|
||||
type: string
|
||||
app-group:
|
||||
default: monitor
|
||||
examples:
|
||||
- monitor
|
||||
type: string
|
||||
dashboards-minimal:
|
||||
default:
|
||||
enable: true
|
||||
examples:
|
||||
- enable: true
|
||||
properties:
|
||||
enable:
|
||||
default: true
|
||||
type: boolean
|
||||
type: object
|
||||
x-vynil-category: monitor
|
||||
x-vynil-package: dashboards-minimal
|
||||
node-exporter:
|
||||
default:
|
||||
enable: true
|
||||
examples:
|
||||
- enable: true
|
||||
properties:
|
||||
enable:
|
||||
default: true
|
||||
type: boolean
|
||||
type: object
|
||||
x-vynil-category: monitor
|
||||
x-vynil-package: node-exporter
|
||||
storage-classes:
|
||||
default:
|
||||
BlockReadWriteMany: ''
|
||||
@@ -221,6 +114,35 @@ options:
|
||||
default: ''
|
||||
type: string
|
||||
type: object
|
||||
node-exporter:
|
||||
default:
|
||||
enable: true
|
||||
examples:
|
||||
- enable: true
|
||||
properties:
|
||||
enable:
|
||||
default: true
|
||||
type: boolean
|
||||
type: object
|
||||
x-vynil-category: monitor
|
||||
x-vynil-package: node-exporter
|
||||
ingress-class:
|
||||
default: traefik
|
||||
examples:
|
||||
- traefik
|
||||
type: string
|
||||
monitor-control-plan:
|
||||
default:
|
||||
enable: false
|
||||
examples:
|
||||
- enable: false
|
||||
properties:
|
||||
enable:
|
||||
default: false
|
||||
type: boolean
|
||||
type: object
|
||||
x-vynil-category: monitor
|
||||
x-vynil-package: monitor-control-plan
|
||||
alerts-core:
|
||||
default:
|
||||
enable: true
|
||||
@@ -233,6 +155,120 @@ options:
|
||||
type: object
|
||||
x-vynil-category: monitor
|
||||
x-vynil-package: alerts-core
|
||||
prometheus:
|
||||
default:
|
||||
enable: true
|
||||
examples:
|
||||
- enable: true
|
||||
properties:
|
||||
enable:
|
||||
default: true
|
||||
type: boolean
|
||||
type: object
|
||||
x-vynil-category: monitor
|
||||
x-vynil-package: prometheus
|
||||
kube-state-metrics:
|
||||
default:
|
||||
enable: true
|
||||
examples:
|
||||
- enable: true
|
||||
properties:
|
||||
enable:
|
||||
default: true
|
||||
type: boolean
|
||||
type: object
|
||||
x-vynil-category: monitor
|
||||
x-vynil-package: kube-state-metrics
|
||||
domain:
|
||||
default: your-company
|
||||
examples:
|
||||
- your-company
|
||||
type: string
|
||||
distributions:
|
||||
default:
|
||||
core: core
|
||||
domain: domain
|
||||
examples:
|
||||
- core: core
|
||||
domain: domain
|
||||
properties:
|
||||
core:
|
||||
default: core
|
||||
type: string
|
||||
domain:
|
||||
default: domain
|
||||
type: string
|
||||
type: object
|
||||
alerts-containers:
|
||||
default:
|
||||
enable: true
|
||||
examples:
|
||||
- enable: true
|
||||
properties:
|
||||
enable:
|
||||
default: true
|
||||
type: boolean
|
||||
type: object
|
||||
x-vynil-category: monitor
|
||||
x-vynil-package: alerts-containers
|
||||
dashboards-minimal:
|
||||
default:
|
||||
enable: true
|
||||
examples:
|
||||
- enable: true
|
||||
properties:
|
||||
enable:
|
||||
default: true
|
||||
type: boolean
|
||||
type: object
|
||||
x-vynil-category: monitor
|
||||
x-vynil-package: dashboards-minimal
|
||||
promtail:
|
||||
default:
|
||||
enable: true
|
||||
examples:
|
||||
- enable: true
|
||||
properties:
|
||||
enable:
|
||||
default: true
|
||||
type: boolean
|
||||
type: object
|
||||
x-vynil-category: monitor
|
||||
x-vynil-package: promtail
|
||||
domain-name:
|
||||
default: your_company.com
|
||||
examples:
|
||||
- your_company.com
|
||||
type: string
|
||||
grafana:
|
||||
default:
|
||||
enable: true
|
||||
examples:
|
||||
- enable: true
|
||||
properties:
|
||||
enable:
|
||||
default: true
|
||||
type: boolean
|
||||
type: object
|
||||
x-vynil-category: monitor
|
||||
x-vynil-package: grafana
|
||||
app-group:
|
||||
default: monitor
|
||||
examples:
|
||||
- monitor
|
||||
type: string
|
||||
dashboards-cluster:
|
||||
default:
|
||||
enable: true
|
||||
examples:
|
||||
- enable: true
|
||||
properties:
|
||||
enable:
|
||||
default: true
|
||||
type: boolean
|
||||
type: object
|
||||
x-vynil-category: monitor
|
||||
x-vynil-package: dashboards-cluster
|
||||
dependencies: []
|
||||
providers:
|
||||
kubernetes: true
|
||||
|
||||
Reference in New Issue
Block a user