Better jsonnet format

This commit is contained in:
CarlosEDP 2019-05-08 22:23:16 -03:00
parent 5590ec8538
commit 4a62faced2
2 changed files with 8 additions and 8 deletions

View File

@ -11,8 +11,8 @@ local kp = (import 'kube-prometheus/kube-prometheus.libsonnet')
+ (import 'smtp_server.jsonnet')
// Additional Modules
+ (if vars.installModules['arm-exporter'] then (import 'arm_exporter.jsonnet') else {})
+ (if vars.installModules.metallb then (import 'metallb.jsonnet') else {})
+ (if vars.installModules.traefik then (import 'traefik.jsonnet') else {})
+ (if vars.installModules['metallb-exporter'] then (import 'metallb.jsonnet') else {})
+ (if vars.installModules['traefik-exporter'] then (import 'traefik.jsonnet') else {})
+ (if vars.installModules['ups-exporter'] then (import 'ups_exporter.jsonnet') else {})
+ (if vars.installModules['elastic-exporter'] then (import 'elasticsearch_exporter.jsonnet') else {})
// Load image versions last to override default from modules
@ -31,9 +31,9 @@ local kp = (import 'kube-prometheus/kube-prometheus.libsonnet')
// Additional Modules
(if vars.installModules['arm-exporter'] then
{ ['arm-exporter-' + name]: kp.armExporter[name] for name in std.objectFields(kp.armExporter) } else {}) +
(if vars.installModules.metallb then
(if vars.installModules['metallb-exporter'] then
{ ['metallb-' + name]: kp.metallb[name] for name in std.objectFields(kp.metallb) } else {}) +
(if vars.installModules.traefik then
(if vars.installModules['traefik-exporter'] then
{ ['traefik-' + name]: kp.traefik[name] for name in std.objectFields(kp.traefik) } else {}) +
(if vars.installModules['ups-exporter'] then
{ ['ups-exporter-' + name]: kp.upsExporter[name] for name in std.objectFields(kp.upsExporter) } else {}) +

View File

@ -2,8 +2,8 @@
// Enable or disable additional modules
installModules: {
'arm-exporter': false,
metallb: false,
traefik: false,
'metallb-exporter': false,
'traefik-exporter': false,
'ups-exporter': false,
'elastic-exporter': false,
},
@ -15,7 +15,7 @@
},
// Domain suffix for the ingresses
suffixDomain: "192.168.99.100.nip.io",
suffixDomain: '192.168.99.100.nip.io',
// Grafana "from" email
grafana: {