-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild_mixins.sh
executable file
·61 lines (54 loc) · 2.97 KB
/
build_mixins.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
if test -d kubernetes-mixin; then
# build kubernetes-mixin
jsonnet -J kubernetes-mixin/vendor -m grafana-prometheus/config/prometheus_rules kubernetes-prometheus.jsonnet
jsonnet -J kubernetes-mixin/vendor -m grafana-prometheus/config/grafana_dashboards kubernetes-grafana.jsonnet
else
echo "kubernetes-mixin does not exist, skipping."
fi
if test -d node-mixin; then
# build node-mixin
jsonnet -J node-mixin/vendor -m grafana-prometheus/config/prometheus_rules node-prometheus.jsonnet
jsonnet -J node-mixin/vendor -m grafana-prometheus/config/grafana_dashboards node-grafana.jsonnet
else
echo "node-mixin does not exist, skipping."
fi
if test -d prometheus-mixin; then
# build prometheus-mixin
jsonnet -J prometheus-mixin/vendor -m grafana-prometheus/config/prometheus_rules prometheus-prometheus.jsonnet
jsonnet -J prometheus-mixin/vendor -m grafana-prometheus/config/grafana_dashboards prometheus-grafana.jsonnet
else
echo "prometheus-mixin does not exist, skipping."
fi
kubectl create configmap prometheus-config-rules --from-file=grafana-prometheus/config/prometheus_rules/ -o yaml --dry-run > grafana-prometheus-kube/manifest/prometheus-rules-config.yaml
echo " namespace: monitor" >> grafana-prometheus-kube/manifest/prometheus-rules-config.yaml
kubectl create configmap grafana-volume-dashboards --from-file=grafana-prometheus/config/grafana_dashboards/ -o yaml --dry-run > grafana-prometheus-kube/manifest/grafana-dashboards-config.yaml
echo " namespace: monitor" >> grafana-prometheus-kube/manifest/grafana-dashboards-config.yaml
#if test -d elasticsearch-mixin; then
# build elasticsearch-mixin
# jsonnet -J elasticsearch-mixin/vendor -m grafana-prometheus/config/prometheus_rules elasticsearch-prometheus.jsonnet
# jsonnet -J elasticsearch-mixin/vendor -m grafana-prometheus/config/grafana_dashboards elasticsearch-grafana.jsonnet
#else
# echo "elasticsearch-mixin does not exist, skipping."
#fi
#if test -d etcd-mixin; then
# build etcd-mixin
# jsonnet -J etcd-mixin/vendor -m grafana-prometheus/config/prometheus_rules etcd-prometheus.jsonnet
# jsonnet -J etcd-mixin/vendor -m grafana-prometheus/config/grafana_dashboards etcd-grafana.jsonnet
#else
# echo "etcd-mixin does not exist, skipping."
#fi
#if test -d nasa-swpc-mixin; then
# build nasa-swpc-mixin
# jsonnet -J nasa-swpc-mixin/vendor -m grafana-prometheus/config/prometheus_rules nasa-swpc-prometheus.jsonnet
# jsonnet -J nasa-swpc-mixin/vendor -m grafana-prometheus/config/grafana_dashboards nasa-swpc-grafana.jsonnet
#else
# echo "nasa-swpc-mixin does not exist, skipping."
#fi
#if test -d elasticsearch-mixin; then
# build elasticsearch-mixin
# jsonnet -J elasticsearch-mixin/vendor -m grafana-prometheus/config/prometheus_rules elasticsearch-prometheus.jsonnet
# jsonnet -J elasticsearch-mixin/vendor -m grafana-prometheus/config/grafana_dashboards elasticsearch-grafana.jsonnet
#else
# echo "elasticsearch-mixin does not exist, skipping."
#fi