Skip to content

Commit fb3c85e

Browse files
committed
update k8s deploy script
1 parent 6cabf66 commit fb3c85e

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

k8s/deploy.ps1

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,28 @@ kubectl create secret docker-registry registry-key `
2626
--docker-password=$dockerPassword `
2727
--docker-email=not@used.com
2828

29-
# start sql and frontend deployments
29+
# start sql, rabbitmq, frontend deployments
3030
kubectl create configmap config-files --from-file=nginx-conf=nginx.conf
3131
kubectl label configmap config-files app=eshop
32-
kubectl create -f sql-data.yaml -f services.yaml -f frontend.yaml
32+
kubectl create -f sql-data.yaml -f rabbitmq.yaml -f services.yaml -f frontend.yaml
3333

34-
Write-Host "Building solution..." -ForegroundColor Yellow
35-
../cli-windows/build-bits-simple.ps1
34+
Write-Host "Building and publishing eShopOnContainers..." -ForegroundColor Yellow
35+
dotnet restore ../eShopOnContainers-ServicesAndWebApps.sln
36+
dotnet publish -c Release -o obj/Docker/publish ../eShopOnContainers-ServicesAndWebApps.sln
3637

3738
Write-Host "Building Docker images..." -ForegroundColor Yellow
3839
docker-compose -p .. -f ../docker-compose.yml build
3940

4041
Write-Host "Pushing images to $registry..." -ForegroundColor Yellow
4142
$services = ("basket.api", "catalog.api", "identity.api", "ordering.api", "webmvc", "webspa")
4243
foreach ($service in $services) {
43-
docker tag eshop/$service $registry/$service
44-
docker push $registry/$service
44+
docker tag eshop/$service $registry/eshop/$service
45+
docker push $registry/eshop/$service
4546
}
4647

4748
Write-Host "Waiting for frontend's external ip..." -ForegroundColor Yellow
4849
while ($true) {
49-
$frontendUrl = kubectl get svc frontend -o=jsonpath="{.status.loadBalancer.ingress[0].ip}" 2> $_
50+
$frontendUrl = kubectl get svc frontend -o=jsonpath="{.status.loadBalancer.ingress[0].ip}"
5051
if ([bool]($frontendUrl -as [ipaddress])) {
5152
break
5253
}
@@ -62,19 +63,18 @@ kubectl create configmap urls `
6263
--from-literal=SpaClient=http://$($frontendUrl)
6364
kubectl label configmap urls app=eshop
6465

65-
# TODO verify database readiness?
6666
Write-Host "Creating deployments..."
6767
kubectl apply -f deployments.yaml
6868

69-
# update deployments with the private registry
69+
# update deployments with the private registry before k8s tries to pull images
7070
# (deployment templating, or Helm, would obviate this)
7171
kubectl set image -f deployments.yaml `
72-
basket=$registry/basket.api `
73-
catalog=$registry/catalog.api `
74-
identity=$registry/identity.api `
75-
ordering=$registry/ordering.api `
76-
webmvc=$registry/webmvc `
77-
webspa=$registry/webspa
72+
basket=$registry/eshop/basket.api `
73+
catalog=$registry/eshop/catalog.api `
74+
identity=$registry/eshop/identity.api `
75+
ordering=$registry/eshop/ordering.api `
76+
webmvc=$registry/eshop/webmvc `
77+
webspa=$registry/eshop/webspa
7878
kubectl rollout resume -f deployments.yaml
7979

8080
Write-Host "WebSPA is exposed at http://$frontendUrl, WebMVC at http://$frontendUrl/webmvc" -ForegroundColor Yellow

0 commit comments

Comments
 (0)