forked from giantswarm/prometheus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·42 lines (37 loc) · 1.81 KB
/
build.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
#!/bin/sh
# Create ConfigMap with prometheus rules for alerting
kubectl --namespace monitoring create configmap --dry-run prometheus-rules \
--from-file=configs/prometheus/rules \
--output yaml \
> ./manifests/prometheus/prometheus-rules.yaml
# Workaround since `--namespace monitoring` from above is not preserved
echo " namespace: monitoring" >> ./manifests/prometheus/prometheus-rules.yaml
# Create ConfigMap for an external url
kubectl --namespace monitoring create configmap --dry-run alertmanager-templates \
--from-file=configs/alertmanager-templates \
--output yaml \
> ./manifests/alertmanager/alertmanager-templates.yaml
# Workaround since `--namespace monitoring` from above is not preserved
echo " namespace: monitoring" >> ./manifests/alertmanager/alertmanager-templates.yaml
# Create ConfigMap with Grafana dashboards and datasources
kubectl --namespace monitoring create configmap --dry-run grafana-import-dashboards \
--from-file=configs/grafana \
--output yaml \
> ./manifests/grafana/import-dashboards/configmap.yaml
# Workaround since `--namespace monitoring` from above is not preserved
echo " namespace: monitoring" >> ./manifests/grafana/import-dashboards/configmap.yaml
# Create ConfigMap with Prometheus config
kubectl --namespace monitoring create configmap --dry-run prometheus-core \
--from-file=configs/prometheus/prometheus.yaml \
--output yaml \
> ./manifests/prometheus/configmap.yaml
# Workaround since `--namespace monitoring` from above is not preserved
echo " namespace: monitoring" >> ./manifests/prometheus/configmap.yaml
# Create one single manifest file
target="./manifests-all.yaml"
rm "$target"
echo "# Derived from ./manifests" >> "$target"
for file in $(find ./manifests -type f -name "*.yaml" | sort) ; do
echo "---" >> "$target"
cat "$file" >> "$target"
done