forked from Midburn/midburn-k8s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelm_healthcheck.sh
executable file
·74 lines (59 loc) · 2.58 KB
/
helm_healthcheck.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
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/bin/env bash
source connect.sh
RES=0
echo "Performing health checks for all charts of ${K8S_ENVIRONMENT_NAME} environment"
root_healthcheck() {
! [ "`./read_env_yaml.sh global enableRootChart`" == "true" ] \
&& echo "root chart is disabled, skipping healthcheck" && return 0
kubectl rollout status deployment/adminer &&\
kubectl rollout status deployment/nginx &&\
kubectl rollout status deployment/traefik
}
spark_healthcheck() {
! [ "`./read_env_yaml.sh spark enabled`" == "true" ] \
&& echo "spark is disabled, skipping healthcheck" && return 0
kubectl rollout status deployment/spark &&\
kubectl rollout status deployment/sparkdb
}
volunteers_healthcheck() {
! [ "`./read_env_yaml.sh volunteers enabled`" == "true" ] \
&& echo "volunteers is disabled, skipping healthcheck" && return 0
kubectl rollout status deployment/volunteers &&\
kubectl rollout status deployment/volunteersdb
}
bi_healthcheck() {
! [ "`./read_env_yaml.sh bi enabled`" == "true" ] \
&& echo "bi is disabled, skipping healthcheck" && return 0
kubectl rollout status deployment/metabase
}
profiles_healthcheck() {
! [ "`./read_env_yaml.sh profiles enabled`" == "true" ] \
&& echo "profiles is disabled, skipping healthcheck" && return 0
kubectl rollout status deployment/profiles-drupal &&\
kubectl rollout status deployment/profiles-db
}
chatops_healthcheck() {
! [ "`./read_env_yaml.sh chatops enabled`" == "true" ] \
&& echo "chatops is disabled, skipping healthcheck" && return 0
kubectl rollout status deployment/chatops
}
dreams_healthcheck() {
! [ "`./read_env_yaml.sh dreams enabled`" == "true" ] \
&& echo "dreams is disabled, skipping healthcheck" && return 0
kubectl rollout status deployment/dreams
}
camps_index_healthcheck() {
! [ "`./read_env_yaml.sh camps-index enabled`" == "true" ] \
&& echo "camps index is disabled, skipping healthcheck" && return 0
kubectl rollout status deployment/camps-index
}
! root_healthcheck && echo failed root healthcheck && RES=1;
! spark_healthcheck && echo failed spark healthcheck && RES=1;
! volunteers_healthcheck && echo failed volunteers healthcheck && RES=1;
! bi_healthcheck && echo failed bi healthcheck && RES=1;
! profiles_healthcheck && echo failed profiles healthcheck && RES=1;
! chatops_healthcheck && echo failed chatops healthcheck && RES=1;
! dreams_healthcheck && echo failed dreams healthcheck && RES=1;
! camps_index_healthcheck && echo failed camps index healthcheck && RES=1;
[ "${RES}" == "0" ] && echo Great Success!
exit $RES