-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart-dev.sh
117 lines (93 loc) · 4.4 KB
/
start-dev.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
kubectl label node dailyon type=App
kubectl label node dailyon size=Large
kubectl label node dailyon-m02 type=App
kubectl label node dailyon-m02 size=Medium
kubectl label node dailyon-m03 type=Util
kubectl label node dailyon-m03 size=Small
kubectl label node dailyon-m04 type=Kafka
kubectl label node dailyon-m05 type=Redis
kubectl label node dailyon-m06 type=App
kubectl label node dailyon-m06 size=Medium
kubectl label node dailyon-m07 type=App
kubectl label node dailyon-m07 size=Medium
kubectl create -f ./kube-config/dev/namespace.yml
kubectl create -f ./kube-config/dev/mysql-config.yml
kubectl create -f ./kafka/dev/deployment.yml
kubectl create -f ./kafka/dev/service.yml
kubectl create -f ./redis/dev/deployment.yml
kubectl create -f ./redis/dev/service.yml
kubectl create -f ./rabbitmq/dev/deployment.yml
kubectl create -f ./rabbitmq/dev/service.yml
kubectl create -f ./discovery-service/deployment.yml
kubectl create -f ./discovery-service/service.yml
discovery_service_pod_names=$(kubectl get pods -l app="discovery-service" -n "dev" --output=jsonpath='{.items[*].metadata.name}')
for pod_name in $discovery_service_pod_names; do
attempt=0
while [[ $attempt -lt 3 ]]; do
readiness_probe_status=$(kubectl get pod "${pod_name}" -n "dev" --template='{{range .status.conditions}}{{if eq .type "Ready"}}{{.status}}{{end}}{{end}}')
if [[ "${readiness_probe_status}" == "True" ]]; then
echo "Readiness probe is healthy for pod ${pod_name} in namespace dev."
kubectl create configmap dailyon-config --from-env-file=./config-service/.env -n dev
kubectl create -f ./config-service/deployment.yml
kubectl create -f ./config-service/service.yml
break
else
echo "Readiness probe is not healthy for pod ${pod_name} in namespace dev. Sleeping for 60 seconds..."
sleep 60
((attempt++))
fi
done
done
config_service_pod_names=$(kubectl get pods -l app="config-service" -n "dev" --output=jsonpath='{.items[*].metadata.name}')
for pod_name in $config_service_pod_names; do
attempt=0
while [[ $attempt -lt 3 ]]; do
readiness_probe_status=$(kubectl get pod "${pod_name}" -n "dev" --template='{{range .status.conditions}}{{if eq .type "Ready"}}{{.status}}{{end}}{{end}}')
if [[ "${readiness_probe_status}" == "True" ]]; then
echo "Readiness probe is healthy for pod ${pod_name} in namespace dev."
break
else
echo "Readiness probe is not healthy for pod ${pod_name} in namespace dev. Sleeping for 60 seconds..."
sleep 60
((attempt++))
fi
done
done
kubectl create -f ./apigateway-service/deployment.yml
kubectl create -f ./apigateway-service/service.yml
kubectl apply -f ./auth-service/initdb-config.yml
kubectl create -f ./auth-service/deployment.yml
kubectl create -f ./auth-service/service.yml
kubectl apply -f ./member-service/initdb-config.yml
kubectl create -f ./member-service/deployment.yml
kubectl create -f ./member-service/service.yml
kubectl apply -f ./payment-service/initdb-config.yml
kubectl create -f ./payment-service/deployment.yml
kubectl create -f ./payment-service/service.yml
kubectl apply -f ./order-service/initdb-config.yml
kubectl create -f ./order-service/deployment.yml
kubectl create -f ./order-service/service.yml
kubectl apply -f ./product-service/initdb-config.yml
kubectl create -f ./product-service/deployment.yml
kubectl create -f ./product-service/service.yml
kubectl apply -f ./promotion-service/initdb-config.yml
kubectl create -f ./promotion-service/deployment.yml
kubectl create -f ./promotion-service/service.yml
kubectl apply -f ./sns-service/initdb-config.yml
kubectl create -f ./sns-service/deployment.yml
kubectl create -f ./sns-service/service.yml
kubectl apply -f ./review-service/initdb-config.yml
kubectl create -f ./review-service/deployment.yml
kubectl create -f ./review-service/service.yml
kubectl apply -f ./notification-service/initdb-config.yml
kubectl create -f ./notification-service/deployment.yml
kubectl create -f ./notification-service/service.yml
kubectl apply -f ./wish-cart-service/initdb-config.yml
kubectl create -f ./wish-cart-service/deployment.yml
kubectl create -f ./wish-cart-service/service.yml
kubectl apply -f ./auction-service/initdb-config.yml
kubectl create -f ./auction-service/deployment.yml
kubectl create -f ./auction-service/service.yml
kubectl apply -f ./search-service/initdb-config.yml
kubectl create -f ./search-service/deployment.yml
kubectl create -f ./search-service/service.yml