-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·40 lines (32 loc) · 1.1 KB
/
setup.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
#!/usr/bin/env bash
echo "[debug] detecting chart repo existance"
helm repo list | grep -q 'prometheus-community'
if [ $? -ne 0 ]; then
echo "[debug] setup chart repo"
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts || true
else
echo "[debug] found chart repo"
fi
echo "[debug] helm repo update"
helm repo update prometheus-community
echo "[debug] detecting namespace existance"
kubectl get namespace | grep -q 'prometheus'
if [ $? -ne 0 ]; then
echo "[debug] creating namespace"
kubectl create namespace prometheus
else
echo "[debug] found namespace"
fi
echo "[debug] detecting Helm resource existance"
helm list --all-namespaces | grep -q 'prometheus'
echo "[debug] setup prometheus-community/prometheus"
helm upgrade \
--namespace prometheus \
--install prometheus \
prometheus-community/prometheus
# --set alertmanager.enabled=false \
# --set kube-state-metrics.enabled=false \
# --set prometheus-node-exporter.enabled=false \
# --set prometheus-pushgateway.enabled=false
echo "[debug] listing installed"
helm list --all-namespaces --filter prometheus