add grafana dashboard for ups [ci skip]

This commit is contained in:
Viktor Barzin 2024-12-15 20:58:01 +00:00
parent 1adf7a7c05
commit 3899dca6e6
4 changed files with 1616 additions and 69 deletions

View file

@ -86,77 +86,77 @@ resource "helm_release" "prometheus" {
# values = [file("${path.module}/ups_snmp_values.yaml")]
# }
resource "kubernetes_secret" "prometheus_grafana_datasource" {
metadata {
name = "prometheus-grafana-datasource"
namespace = "monitoring"
# resource "kubernetes_secret" "prometheus_grafana_datasource" {
# metadata {
# name = "prometheus-grafana-datasource"
# namespace = "monitoring"
labels = {
grafana_datasource = "1"
}
}
# labels = {
# grafana_datasource = "1"
# }
# }
data = {
"datasource.yaml" = <<EOT
# config file version
apiVersion: 1
# data = {
# "datasource.yaml" = <<EOT
# # config file version
# apiVersion: 1
# list of datasources that should be deleted from the database
#deleteDatasources:
# # list of datasources that should be deleted from the database
# #deleteDatasources:
# # - name: Prometheus
# # orgId: 1
# # list of datasources to insert/update depending
# # whats available in the database
# datasources:
# # <string, required> name of the datasource. Required
# - name: Prometheus
# # <string, required> datasource type. Required
# type: prometheus
# # <string, required> access mode. proxy or direct (Server or Browser in the UI). Required
# access: proxy
# # <int> org id. will default to orgId 1 if not specified
# orgId: 1
# # <string> url
# url: http://prometheus-server
# # <string> database password, if used
# password:
# # <string> database user, if used
# user:
# # <string> database name, if used
# database:
# # <bool> enable/disable basic auth
# basicAuth:
# # <string> basic auth username
# basicAuthUser:
# # <string> basic auth password
# basicAuthPassword:
# # <bool> enable/disable with credentials headers
# withCredentials:
# # <bool> mark as default datasource. Max one per org
# isDefault:
# # <map> fields that will be converted to json and stored in json_data
# #jsonData:
# # graphiteVersion: \"1.1\"
# # tlsAuth: true
# # tlsAuthWithCACert: true
# # <string> json object of data that will be encrypted.
# #secureJsonData:
# # tlsCACert: \"...\"
# # tlsClientCert: \"...\"
# # tlsClientKey: \"...\"
# version: 1
# # <bool> allow users to edit datasources from the UI.
# editable: false
# EOT
# }
# list of datasources to insert/update depending
# whats available in the database
datasources:
# <string, required> name of the datasource. Required
- name: Prometheus
# <string, required> datasource type. Required
type: prometheus
# <string, required> access mode. proxy or direct (Server or Browser in the UI). Required
access: proxy
# <int> org id. will default to orgId 1 if not specified
orgId: 1
# <string> url
url: http://prometheus-server
# <string> database password, if used
password:
# <string> database user, if used
user:
# <string> database name, if used
database:
# <bool> enable/disable basic auth
basicAuth:
# <string> basic auth username
basicAuthUser:
# <string> basic auth password
basicAuthPassword:
# <bool> enable/disable with credentials headers
withCredentials:
# <bool> mark as default datasource. Max one per org
isDefault:
# <map> fields that will be converted to json and stored in json_data
#jsonData:
# graphiteVersion: \"1.1\"
# tlsAuth: true
# tlsAuthWithCACert: true
# <string> json object of data that will be encrypted.
#secureJsonData:
# tlsCACert: \"...\"
# tlsClientCert: \"...\"
# tlsClientKey: \"...\"
version: 1
# <bool> allow users to edit datasources from the UI.
editable: false
EOT
}
type = "Opaque"
}
# type = "Opaque"
# }
resource "kubernetes_persistent_volume" "prometheus_grafana_pv" {
metadata {
name = "grafana-iscsi-pv"
name = "grafana-pv"
}
spec {
capacity = {
@ -195,9 +195,9 @@ resource "kubernetes_persistent_volume" "alertmanager_pv" {
}
}
}
resource "kubernetes_persistent_volume_claim" "prometheus_grafana_pvc" {
resource "kubernetes_persistent_volume_claim" "grafana_pvc" {
metadata {
name = "grafana-iscsi-pvc"
name = "grafana-pvc"
namespace = "monitoring"
}
spec {