Deploy scripts updated: fixing some bugs
This commit is contained in:
parent
18393c9a6a
commit
9cea929372
@ -6,11 +6,11 @@ Param(
|
||||
[parameter(Mandatory=$false)][bool]$useDockerHub,
|
||||
[parameter(Mandatory=$false)][string]$execPath,
|
||||
[parameter(Mandatory=$false)][string]$kubeconfigPath,
|
||||
[parameter(Mandatory=$true)][string]$configFile
|
||||
[parameter(Mandatory=$true)][string]$configFile,
|
||||
[parameter(Mandatory=$false)][bool]$deployInfrastructure=$true
|
||||
)
|
||||
|
||||
$debugMode = $PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent
|
||||
|
||||
function ExecKube($cmd) {
|
||||
if($deployCI) {
|
||||
$kubeconfig = $kubeconfigPath + 'config';
|
||||
@ -75,7 +75,13 @@ ExecKube -cmd 'delete configmap externalcfg'
|
||||
# start sql, rabbitmq, frontend deploymentsExecKube -cmd 'delete configmap config-files'
|
||||
ExecKube -cmd 'create configmap config-files --from-file=nginx-conf=nginx.conf'
|
||||
ExecKube -cmd 'label configmap config-files app=eshop'
|
||||
# ExecKube -cmd 'create -f sql-data.yaml -f basket-data.yaml -f keystore-data.yaml -f rabbitmq.yaml -f services.yaml -f frontend.yaml'
|
||||
|
||||
if ($deployInfrastructure) {
|
||||
Write-Host 'Deploying infrastructure deployments (databases, redis, ...)' -ForegroundColor Yellow
|
||||
ExecKube -cmd 'create -f sql-data.yaml -f basket-data.yaml -f keystore-data.yaml -f rabbitmq.yaml -f nosql-data.yaml'
|
||||
}
|
||||
|
||||
Write-Host 'Deploying code deployments (databases, redis, ...)' -ForegroundColor Yellow
|
||||
ExecKube -cmd 'create -f services.yaml -f frontend.yaml'
|
||||
|
||||
# building and publishing docker images not necessary when deploying through CI VSTS
|
||||
@ -143,6 +149,7 @@ ExecKube -cmd 'create configmap externalcfg `
|
||||
--from-literal=MarketingBus=$($config.servicebus.marketing) `
|
||||
--from-literal=BasketBus=$($config.servicebus.basket) `
|
||||
--from-literal=OrderingBus=$($config.servicebus.ordering) `
|
||||
--from-literal=CatalogBus=$($config.servicebus.catalog) `
|
||||
--from-literal=PaymentBus=$($config.servicebus.payment) '
|
||||
|
||||
ExecKube -cmd 'label configmap externalcfg app=eshop'
|
||||
|
@ -68,6 +68,11 @@ spec:
|
||||
configMapKeyRef:
|
||||
name: urls
|
||||
key: CatalogUrl
|
||||
-name: EventBusConnection
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: externalcfg
|
||||
key: CatalogBus
|
||||
ports:
|
||||
- containerPort: 80
|
||||
imagePullSecrets:
|
||||
|
@ -1,28 +0,0 @@
|
||||
{
|
||||
"sql": {
|
||||
"catalog": "Server=tcp:eshopsql-ez55a72p6wm62.database.windows.net,1433;Initial Catalog=catalogdb;Persist Security Info=False;User ID=eshop;Password=Pass@word!;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;",
|
||||
"identity":"Server=tcp:eshopsql-ez55a72p6wm62.database.windows.net,1433;Initial Catalog=identitydb;Persist Security Info=False;User ID=eshop;Password=Pass@word!;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;",
|
||||
"ordering":"Server=tcp:eshopsql-ez55a72p6wm62.database.windows.net,1433;Initial Catalog=orderingdb;Persist Security Info=False;User ID=eshop;Password=Pass@word!;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;",
|
||||
"marketing":"Server=tcp:eshopsql-ez55a72p6wm62.database.windows.net,1433;Initial Catalog=marketingdb;Persist Security Info=False;User ID=eshop;Password=Pass@word!;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
|
||||
},
|
||||
"nosql": {
|
||||
"locations": {
|
||||
"constr": "mongodb://eshop-nosqlez55a72p6wm62:l8jMNoLHFXOijAvaVMjHeCwHK8gAR9SovuK86uCOvwfnMhuhwytPKByOPqrQrlsDz9RPFet2J6SzEbBQXLZokA==@eshop-nosqlez55a72p6wm62.documents.azure.com:10255/?ssl=true&replicaSet=globaldb",
|
||||
"db": "LocationsDb"
|
||||
},
|
||||
"marketing": {
|
||||
"constr": "mongodb://eshop-nosqlez55a72p6wm62:l8jMNoLHFXOijAvaVMjHeCwHK8gAR9SovuK86uCOvwfnMhuhwytPKByOPqrQrlsDz9RPFet2J6SzEbBQXLZokA==@eshop-nosqlez55a72p6wm62.documents.azure.com:10255/?ssl=true&replicaSet=globaldb",
|
||||
"db": "MarketingDb"
|
||||
}
|
||||
},
|
||||
"redis": {
|
||||
"basket" : "eshopredisez55a72p6wm62.redis.cache.windows.net"
|
||||
},
|
||||
"servicebus": {
|
||||
"ordering": "Endpoint=sb://eshopsbez55a72p6wm62.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=Iv+cC7Wgwc8SCrE5AXrguRW6kRMk6vR7crTVBom5nPU=;EntityPath=eshop_event_bus",
|
||||
"marketing": "Endpoint=sb://eshopsbez55a72p6wm62.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=Iv+cC7Wgwc8SCrE5AXrguRW6kRMk6vR7crTVBom5nPU=;EntityPath=eshop_event_bus",
|
||||
"locations": "Endpoint=sb://eshopsbez55a72p6wm62.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=Iv+cC7Wgwc8SCrE5AXrguRW6kRMk6vR7crTVBom5nPU=;EntityPath=eshop_event_bus",
|
||||
"payment": "Endpoint=sb://eshopsbez55a72p6wm62.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=Iv+cC7Wgwc8SCrE5AXrguRW6kRMk6vR7crTVBom5nPU=;EntityPath=eshop_event_bus",
|
||||
"basket": "Endpoint=sb://eshopsbez55a72p6wm62.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=Iv+cC7Wgwc8SCrE5AXrguRW6kRMk6vR7crTVBom5nPU=;EntityPath=eshop_event_bus"
|
||||
}
|
||||
}
|
@ -22,6 +22,8 @@
|
||||
"ordering": "rabbitmq",
|
||||
"marketing": "rabbitmq",
|
||||
"locations": "rabbitmq",
|
||||
"payment": "rabbitmq"
|
||||
"payment": "rabbitmq",
|
||||
"basket": "rabbitmq",
|
||||
"catalog": "rabbitmq"
|
||||
}
|
||||
}
|
@ -83,8 +83,8 @@ http {
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
||||
location /location-api {
|
||||
proxy_pass http://location;
|
||||
location /locations-api {
|
||||
proxy_pass http://locations;
|
||||
proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
30
k8s/nosql-data.yaml
Normal file
30
k8s/nosql-data.yaml
Normal file
@ -0,0 +1,30 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
app: eshop
|
||||
component: nosql-data
|
||||
name: nosql-data
|
||||
spec:
|
||||
ports:
|
||||
- port: 27017
|
||||
selector:
|
||||
app: eshop
|
||||
component: nosql-data
|
||||
---
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nosql-data
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: eshop
|
||||
component: nosql-data
|
||||
spec:
|
||||
containers:
|
||||
- name: nosql.data
|
||||
image: mongo
|
||||
ports:
|
||||
- containerPort: 27017
|
Loading…
x
Reference in New Issue
Block a user