-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
executable file
·232 lines (209 loc) · 4.27 KB
/
deploy.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
#!/bin/bash
#made for mac osx. deal with it.
function create_namespaces () {
for ns in ragnarok redis pulsar
do
echo "creating namespace $ns"
kubectl create ns $ns
done
}
function deploy_kubernetes_cluster(){
printf "deploying kubernetes ..."
if [[ $target_cloud == *"azure"* ]]
then
printf "Deploying an AKS cluster ...\n"
deploy_aks_cluster
fi
if [[ $target_cloud == *"aws"* ]]
then
printf "Deploying an EKS cluster ...\n"
deploy_eks_cluster
fi
}
function deploy_eks_cluster {
printf "deploying kubernetes cluster on AWS Cloud\n"
mycwd=`pwd`
cd kubernetes/eks-deploy/
./deploy.sh
cd $mycwd
}
function deploy_aks_cluster {
printf "deploying kubernetes cluster on Azure Cloud\n"
mycwd=`pwd`
cd kubernetes/aks-deploy/
./deploy.sh
cd $mycwd
}
function deploy_ingress_controller(){
printf "deploy ingress controllers ..."
mycwd=`pwd`
if [[ $target_cloud == *"azure"* ]]
then
deploy_aks_ingress_controller
fi
if [[ $target_cloud == *"aws"* ]]
then
deploy_eks_ingress_controller
fi
cd $mycwd
}
function deploy_aks_ingress_controller(){
printf "deploy AKS ingress controller ..."
mycwd=`pwd`
cd networking/aks-deploy
./deploy.sh
cd $mycwd
}
function deploy_eks_ingress_controller(){
printf "deploy EKS ingress controller ..."
mycwd=`pwd`
cd networking/eks-deploy
./deploy.sh
cd $mycwd
}
function deploy_prometheus_services () {
mycwd=`pwd`
cd monitoring/prometheus/common
./deploy.sh
cd $mycwd
}
function deploy_grafana_services () {
mycwd=`pwd`
cd monitoring/grafana
./deploy.sh
cd $mycwd
}
function deploy_pulsar_services () {
mycwd=`pwd`
cd pulsar/aks-deploy/apache-pulsar
./deploy.sh
cd $mycwd
}
function deploy_kafka_services () {
mycwd=`pwd`
cd kafka-cp
./deploy.sh
cd $mycwd
}
function deploy_redis_services () {
mycwd=`pwd`
if [[ $target_cloud == *"azure"* ]]
then
cd microservices/storage/redis-storage/aks-deploy
./deploy.sh
fi
if [[ $target_cloud == *"aws"* ]]
then
cd microservices/storage/redis-storage/eks-deploy
./deploy.sh
fi
cd $mycwd
}
function deploy_ingress_service () {
mycwd=`pwd`
if [[ $target_cloud == *"azure"* ]]
then
cd microservices/ingress/aks-deploy
./deploy.sh
fi
if [[ $target_cloud == *"aws"* ]]
then
cd microservices/ingress/eks-deploy
./deploy.sh
fi
cd $mycwd
}
function deploy_sink_service () {
mycwd=`pwd`
if [[ $target_cloud == *"azure"* ]]
then
cd microservices/load-sink/aks-deploy
./deploy.sh
fi
if [[ $target_cloud == *"aws"* ]]
then
cd microservices/load-sink/eks-deploy
./deploy.sh
fi
cd $mycwd
}
function deploy_producer_service () {
mycwd=`pwd`
if [[ $target_cloud == *"azure"* ]]
then
cd microservices/producer/aks-deploy/
./deploy.sh
fi
if [[ $target_cloud == *"aws"* ]]
then
cd microservices/producer/eks-deploy/
./deploy.sh
fi
cd $mycwd
}
function deploy_consumer_service () {
mycwd=`pwd`
if [[ $target_cloud == *"azure"* ]]
then
cd microservices/consumer/aks-deploy/
./deploy.sh
fi
if [[ $target_cloud == *"aws"* ]]
then
cd microservices/consumer/eks-deploy/
./deploy.sh
fi
cd $mycwd
}
function deploy_loader_service () {
mycwd=`pwd`
if [[ $target_cloud == *"azure"* ]]
then
cd microservices/loader/aks-deploy/
./deploy.sh
cd rbac-config
./deploy.sh
fi
if [[ $target_cloud == *"aws"* ]]
then
cd microservices/loader/eks-deploy/
./deploy.sh
cd rbac-config
./deploy.sh
fi
cd $mycwd
}
function deploy_local_storage () {
mycwd=`pwd`
if [[ $target_cloud == *"azure"* ]]
then
cd microservices/storage/afs-storage/ && ./deploy.sh
fi
if [[ $target_cloud == *"aws"* ]]
then
printf "no storage for EKS ...\n"
fi
cd $mycwd
}
function update_registry_access () {
mycwd=`pwd`
cd microservices/producer/build/ && ./create-secret.sh
cd $mycwd
}
#Deployment to Azure Cloud
deploy_kubernetes_cluster
create_namespaces
deploy_ingress_controller
deploy_ingress_service
deploy_prometheus_services
deploy_grafana_services
deploy_redis_services
#make this selectable at some point!
#deploy_kafka_services
deploy_pulsar_services
deploy_local_storage
update_registry_access
deploy_sink_service
deploy_producer_service
deploy_consumer_service
deploy_loader_service