-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstop.sh
executable file
·42 lines (38 loc) · 1.11 KB
/
stop.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/bash
function reverse_word_order {
local result
for word in $@; do
result="$word $result"
done
echo "$result"
}
# InfluxDB
INFLUX_MF="pvc secrets config deployment service"
INFLUXDB_DIR="influxdb"
for MF in $(reverse_word_order ${INFLUX_MF}); do
if [ ! -e ${INFLUXDB_DIR}/${MF}.yaml ]; then
echo "Could not find ${INFLUXDB_DIR}/${MF}.yaml"
exit 1
fi
kubectl delete -f ${INFLUXDB_DIR}/${MF}.yaml
done
# Chronograf
CHRONOGRAF_MF="pvc deployment service"
CHRONOGRAF_DIR="chronograf"
for MF in $(reverse_word_order ${CHRONOGRAF_MF}); do
if [ ! -e ${CHRONOGRAF_DIR}/${MF}.yaml ]; then
echo "Could not find ${CHRONOGRAF_DIR}/${MF}.yaml"
exit 1
fi
kubectl delete -f${CHRONOGRAF_DIR}/${MF}.yaml
done
# Grafana
GRAFANA_MF="pvc secrets config config-dashboards config-datasources deployment service"
GRAFANA_DIR="grafana"
for MF in $(reverse_word_order ${GRAFANA_MF}); do
if [ ! -e ${GRAFANA_DIR}/${MF}.yaml ]; then
echo "Could not find ${GRAFANA_DIR}/${MF}.yaml"
exit 1
fi
kubectl delete -f ${GRAFANA_DIR}/${MF}.yaml
done