Deploy scripts updated: fixing some bugs
This commit is contained in:
parent
5dd1ce24f3
commit
bd3d5072ed
@ -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:
|
||||
|
@ -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