@@ -43,6 +43,10 @@ Parameters:
43
43
The Docker username used to logon to the custom registry, supplied using the -r parameter.
44
44
--use-local-k8s
45
45
Deploy to a locally installed Kubernetes (default: false).
46
+ --use-mesh
47
+ Use Linkerd as service mesh
48
+ --image-pull-policy <policy>
49
+ Image Pull Policy: Always, IfNotPresent, Never (default: Always)
46
50
47
51
It is assumed that the Kubernetes cluster has been granted access to the container registry.
48
52
If using AKS and ACR see link for more info:
@@ -72,6 +76,9 @@ push_images=''
72
76
skip_infrastructure=' '
73
77
use_local_k8s=' '
74
78
namespace=' eshop'
79
+ use_mesh=' false'
80
+ ingressMeshAnnotationsFile=' ingress_values_linkerd.yaml'
81
+ imagePullPolicy=' Always'
75
82
76
83
while [[ $# -gt 0 ]]; do
77
84
case " $1 " in
@@ -107,12 +114,21 @@ while [[ $# -gt 0 ]]; do
107
114
use_local_k8s=' yes' ; shift ;;
108
115
--namespace )
109
116
namespace=" $2 " ; shift 2;;
117
+ --use-mesh )
118
+ use_mesh=' true' ; shift ;;
119
+ --image-pull-policy )
120
+ imagePullPolicy=" $2 " ; shift 2;;
110
121
* )
111
122
echo " Unknown option $1 "
112
123
usage; exit 2 ;;
113
124
esac
114
125
done
115
126
127
+ if [[ $imagePullPolicy != " Always" && $imagePullPolicy != " Never" && $imagePullPolicy != " IfNotPresent" ]]; then
128
+ echo " --image-pull-policy needs to be a valid value: Always, IfNotPresent, Never"
129
+ usage; exit 2;
130
+ fi
131
+
116
132
if [[ $build_solution ]]; then
117
133
echo " #################### Building $app_name solution ####################"
118
134
dotnet publish -o obj/Docker/publish ../../eShopOnContainers-ServicesAndWebApps.sln
@@ -201,32 +217,39 @@ if [[ $clean ]]; then
201
217
if [[ -z $( helm ls -q --namespace $namespace ) ]]; then
202
218
echo " No previous releases found"
203
219
else
204
- helm uninstall $( helm ls -q --namespace $namespace )
220
+ helm --namespace $namespace uninstall $( helm ls -q --namespace $namespace )
205
221
echo " Previous releases deleted"
206
222
waitsecs=10; while [ $waitsecs -gt 0 ]; do echo -ne " $waitsecs \033[0K\r" ; sleep 1; : $(( waitsecs-- )) ; done
207
223
fi
208
224
fi
209
225
210
226
echo " #################### Begin $app_name installation using Helm ####################"
211
227
infras=(sql-data nosql-data rabbitmq keystore-data basket-data)
212
- charts=(eshop-common apigwms apigwws basket-api catalog-api identity-api mobileshoppingagg ordering-api ordering-backgroundtasks ordering-signalrhub payment-api webmvc webshoppingagg webspa webstatus webhooks-api webhooks-web)
228
+ charts=(eshop-common basket-api catalog-api identity-api mobileshoppingagg ordering-api ordering-backgroundtasks ordering-signalrhub payment-api webmvc webshoppingagg webspa webstatus webhooks-api webhooks-web)
229
+ gateways=(apigwms apigwws)
213
230
214
231
if [[ ! $skip_infrastructure ]]; then
215
232
for infra in " ${infras[@]} "
216
233
do
217
234
echo " Installing infrastructure: $infra "
218
- helm install " $app_name -$infra " --namespace $namespace --set " ingress.hosts={$dns }" --values app.yaml --values inf.yaml --values $ingress_values_file --set app.name=$app_name --set inf.k8s.dns=$dns $infra
235
+ helm install " $app_name -$infra " --namespace $namespace --set " ingress.hosts={$dns }" --values app.yaml --values inf.yaml --values $ingress_values_file --values $ingressMeshAnnotationsFile -- set app.name=$app_name --set inf.k8s.dns=$dns $infra --set inf.mesh.enabled= $use_mesh
219
236
done
220
237
fi
221
238
222
239
for chart in " ${charts[@]} "
223
240
do
224
241
echo " Installing: $chart "
225
- if [[ $use_custom_registry ]]; then
226
- helm install " $app_name -$chart " --namespace $namespace --set " ingress.hosts={$dns }" --set inf.registry.server=$container_registry --set inf.registry.login=$docker_username --set inf.registry.pwd=$docker_password --set inf.registry.secretName=eshop-docker-scret --values app.yaml --values inf.yaml --values $ingress_values_file --set app.name=$app_name --set inf.k8s.dns=$dns --set image.tag=$image_tag --set image.pullPolicy=Always $chart
227
- elif [[ $chart != " eshop-common" ]]; then # eshop-common is ignored when no secret must be deployed
228
- helm install " $app_name -$chart " --namespace $namespace --set " ingress.hosts={$dns }" --values app.yaml --values inf.yaml --values $ingress_values_file --set app.name=$app_name --set inf.k8s.dns=$dns --set image.tag=$image_tag --set image.pullPolicy=Always $chart
242
+ if [[ $use_custom_registry ]]; then
243
+ helm install " $app_name -$chart " --namespace $namespace --set " ingress.hosts={$dns }" --set inf.registry.server=$container_registry --set inf.registry.login=$docker_username --set inf.registry.pwd=$docker_password --set inf.registry.secretName=eshop-docker-scret --values app.yaml --values inf.yaml --values $ingress_values_file --values $ingressMeshAnnotationsFile -- set app.name=$app_name --set inf.k8s.dns=$dns --set image.tag=$image_tag --set image.pullPolicy=$imagePullPolicy $chart --set inf.mesh.enabled= $use_mesh
244
+ elif [[ $chart != " eshop-common" ]]; then # eshop-common is ignored when no secret must be deployed
245
+ helm install " $app_name -$chart " --namespace $namespace --set " ingress.hosts={$dns }" --values app.yaml --values inf.yaml --values $ingress_values_file --values $ingressMeshAnnotationsFile -- set app.name=$app_name --set inf.k8s.dns=$dns --set image.tag=$image_tag --set image.pullPolicy=$imagePullPolicy $chart --set inf.mesh.enabled= $use_mesh
229
246
fi
230
247
done
231
248
232
- echo " FINISHED: Helm charts installed."
249
+ for gw in " ${gateways[@]} "
250
+ do
251
+ echo " Installing gateway: $gw "
252
+ helm install " $app_name -$gw " --namespace $namespace --set " ingress.hosts={$dns }" --values app.yaml --values inf.yaml --values $ingress_values_file --set app.name=$app_name --set inf.k8s.dns=$dns --set image.pullPolicy=$imagePullPolicy $gw
253
+ done
254
+
255
+ echo " FINISHED: Helm charts installed."
0 commit comments