feat: add database generation to grafana
- ensure a database, user and credential is created for each grafana node - ensure all databases for a region are included in a mariadb cluster - refine params with stdlib types
This commit is contained in:
@@ -1,2 +1,49 @@
|
||||
---
|
||||
#profile::metrics::grafana
|
||||
hiera_include:
|
||||
- profiles::nginx::simpleproxy
|
||||
|
||||
profiles::metrics::grafana::mysql_host: "mariadb-%{facts.environment}.service.%{facts.country}-%{facts.region}.consul"
|
||||
profiles::metrics::grafana::mysql_port: 3306
|
||||
|
||||
# additional altnames
|
||||
profiles::pki::vault::alt_names:
|
||||
- grafana.main.unkin.net
|
||||
- grafana.service.consul
|
||||
- grafana.query.consul
|
||||
- "grafana.service.%{facts.country}-%{facts.region}.consul"
|
||||
|
||||
profiles::ssh::sign::principals:
|
||||
- grafana.main.unkin.net
|
||||
- grafana.service.consul
|
||||
- grafana.query.consul
|
||||
|
||||
consul::services:
|
||||
grafana:
|
||||
service_name: 'grafana'
|
||||
tags:
|
||||
- 'grafana'
|
||||
- 'metrics'
|
||||
address: "%{facts.networking.ip}"
|
||||
port: 443
|
||||
checks:
|
||||
- id: 'Grafana_https_check'
|
||||
name: 'Grafana HTTPS Check'
|
||||
http: "https://%{facts.networking.fqdn}:443"
|
||||
method: 'GET'
|
||||
tls_skip_verify: true
|
||||
interval: '10s'
|
||||
timeout: '1s'
|
||||
profiles::consul::client::node_rules:
|
||||
- resource: service
|
||||
segment: grafana
|
||||
disposition: write
|
||||
|
||||
# manage a simple nginx reverse proxy
|
||||
profiles::nginx::simpleproxy::nginx_vhost: 'grafana.query.consul'
|
||||
profiles::nginx::simpleproxy::nginx_aliases:
|
||||
- grafana.main.unkin.net
|
||||
- grafana.service.consul
|
||||
- grafana.query.consul
|
||||
- "grafana.service.%{facts.country}-%{facts.region}.consul"
|
||||
profiles::nginx::simpleproxy::proxy_port: 8080
|
||||
profiles::nginx::simpleproxy::proxy_path: '/'
|
||||
|
||||
@@ -83,3 +83,9 @@ profiles::consul::prepared_query::rules:
|
||||
service_failover_n: 3
|
||||
service_only_passing: true
|
||||
ttl: 10
|
||||
grafana:
|
||||
ensure: 'present'
|
||||
service_name: 'grafana'
|
||||
service_failover_n: 3
|
||||
service_only_passing: true
|
||||
ttl: 10
|
||||
|
||||
Reference in New Issue
Block a user