Browse Source

Deploy scripts updated: fixing some bugs

pull/223/head
Eduard Tomas 7 years ago
parent
commit
bd3d5072ed
5 changed files with 50 additions and 6 deletions
  1. +10
    -3
      k8s/deploy.ps1
  2. +5
    -0
      k8s/deployments.yaml
  3. +3
    -1
      k8s/local.json
  4. +2
    -2
      k8s/nginx.conf
  5. +30
    -0
      k8s/nosql-data.yaml

+ 10
- 3
k8s/deploy.ps1 View File

@ -6,11 +6,11 @@ Param(
[parameter(Mandatory=$false)][bool]$useDockerHub, [parameter(Mandatory=$false)][bool]$useDockerHub,
[parameter(Mandatory=$false)][string]$execPath, [parameter(Mandatory=$false)][string]$execPath,
[parameter(Mandatory=$false)][string]$kubeconfigPath, [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 $debugMode = $PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent
function ExecKube($cmd) { function ExecKube($cmd) {
if($deployCI) { if($deployCI) {
$kubeconfig = $kubeconfigPath + 'config'; $kubeconfig = $kubeconfigPath + 'config';
@ -75,7 +75,13 @@ ExecKube -cmd 'delete configmap externalcfg'
# start sql, rabbitmq, frontend deploymentsExecKube -cmd 'delete configmap config-files' # start sql, rabbitmq, frontend deploymentsExecKube -cmd 'delete configmap config-files'
ExecKube -cmd 'create configmap config-files --from-file=nginx-conf=nginx.conf' ExecKube -cmd 'create configmap config-files --from-file=nginx-conf=nginx.conf'
ExecKube -cmd 'label configmap config-files app=eshop' 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' ExecKube -cmd 'create -f services.yaml -f frontend.yaml'
# building and publishing docker images not necessary when deploying through CI VSTS # 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=MarketingBus=$($config.servicebus.marketing) `
--from-literal=BasketBus=$($config.servicebus.basket) ` --from-literal=BasketBus=$($config.servicebus.basket) `
--from-literal=OrderingBus=$($config.servicebus.ordering) ` --from-literal=OrderingBus=$($config.servicebus.ordering) `
--from-literal=CatalogBus=$($config.servicebus.catalog) `
--from-literal=PaymentBus=$($config.servicebus.payment) ' --from-literal=PaymentBus=$($config.servicebus.payment) '
ExecKube -cmd 'label configmap externalcfg app=eshop' ExecKube -cmd 'label configmap externalcfg app=eshop'


+ 5
- 0
k8s/deployments.yaml View File

@ -68,6 +68,11 @@ spec:
configMapKeyRef: configMapKeyRef:
name: urls name: urls
key: CatalogUrl key: CatalogUrl
-name: EventBusConnection
valueFrom:
configMapKeyRef:
name: externalcfg
key: CatalogBus
ports: ports:
- containerPort: 80 - containerPort: 80
imagePullSecrets: imagePullSecrets:


+ 3
- 1
k8s/local.json View File

@ -22,6 +22,8 @@
"ordering": "rabbitmq", "ordering": "rabbitmq",
"marketing": "rabbitmq", "marketing": "rabbitmq",
"locations": "rabbitmq", "locations": "rabbitmq",
"payment": "rabbitmq"
"payment": "rabbitmq",
"basket": "rabbitmq",
"catalog": "rabbitmq"
} }
} }

+ 2
- 2
k8s/nginx.conf View File

@ -83,8 +83,8 @@ http {
proxy_set_header Host $host; proxy_set_header Host $host;
} }
location /location-api {
proxy_pass http://location;
location /locations-api {
proxy_pass http://locations;
proxy_redirect off; proxy_redirect off;
proxy_set_header Host $host; proxy_set_header Host $host;
} }


+ 30
- 0
k8s/nosql-data.yaml View 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…
Cancel
Save