Skip to content

Commit

Permalink
k8s config updated
Browse files Browse the repository at this point in the history
  • Loading branch information
eiximenis committed Mar 14, 2018
1 parent a34ed28 commit 5bb6759
Show file tree
Hide file tree
Showing 17 changed files with 1,046 additions and 380 deletions.
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,37 +109,37 @@ services:
image: rabbitmq:3-management-alpine

mobileshoppingapigw:
image: eshop/ocelotapigw-ms
image: eshop/ocelotapigw-ms:${TAG:-latest}
build:
context: .
dockerfile: src/ApiGateways/ApiGw-Base/Dockerfile

mobilemarketingapigw:
image: eshop/ocelotapigw-mm
image: eshop/ocelotapigw-mm:${TAG:-latest}
build:
context: .
dockerfile: src/ApiGateways/ApiGw-Base/Dockerfile2

webshoppingapigw:
image: eshop/ocelotapigw-ws
image: eshop/ocelotapigw-ws:${TAG:-latest}
build:
context: .
dockerfile: src/ApiGateways/ApiGw-Base/Dockerfile3

webmarketingapigw:
image: eshop/ocelotapigw-wm
image: eshop/ocelotapigw-wm:${TAG:-latest}
build:
context: .
dockerfile: src/ApiGateways/ApiGw-Base/Dockerfile

mobileshoppingagg:
image: eshop/mobileshoppingagg
image: eshop/mobileshoppingagg:${TAG:-latest}
build:
context: .
dockerfile: src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile

webshoppingagg:
image: eshop/webshoppingagg
image: eshop/webshoppingagg:${TAG:-latest}
build:
context: .
dockerfile: src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile
Expand Down
14 changes: 7 additions & 7 deletions k8s/conf_cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ metadata:
name: externalcfg
labels:
app: eshop
data:
data:
# Basket.API entries
BasketBus: CONNECTION_STRING (NAME OF RABBITMQ CONTAINER OR Endpoint=sb://XXXX in case of using Azure)
BasketRedisConStr: REDIS CONNECTION STRING FOR BASKET
basket__ConnectionString: REDIS CONNECTION STRING FOR BASKET
# Catalog.API entries
CatalogBus: CONNECTION_STRING (NAME OF RABBITMQ CONTAINER OR Endpoint=sb://XXXX in case of using Azure)
CatalogSqlDb: Catalog SQL SERVER CONNECTION STRING (Server=xxxx;Intial Catalog=yyy;....)
catalog__ConnectionString: Catalog SQL SERVER CONNECTION STRING (Server=xxxx;Intial Catalog=yyy;....)
# Identity.API entries
IdentitySqlDb: Identity SQL SERVER CONNECTION STRING (Server=xxxx;Intial Catalog=yyy;....)
# Locations.API entries
Expand All @@ -30,5 +28,7 @@ data:
# Payment.API entries
PaymentBus: CONNECTION_STRING (NAME OF RABBITMQ CONTAINER OR Endpoint=sb://XXXX in case of using Azure)
# Global entries
UseAzureServiceBus: "TRUE" IF USE AZURE SB ("FALSE" FOR USING RABBITMQ)
keystore: REDIS CONNECTION STRING FOR KEYSTORE
all_UseAzureServiceBus: "TRUE" IF USE AZURE SB ("FALSE" FOR USING RABBITMQ)
keystore: REDIS CONNECTION STRING FOR KEYSTORE
all_EventBusConnection: CONNECTION_STRING (NAME OF RABBITMQ CONTAINER OR Endpoint=sb://XXXX in case of using Azure)
all_InstrumentationKey: APPINSIGHTS KEY
37 changes: 16 additions & 21 deletions k8s/conf_local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,23 @@ metadata:
labels:
app: eshop
data:
BasketBus: rabbitmq
BasketRedisConStr: basket-data
CatalogBus: rabbitmq
CatalogSqlDb: Server=sql-data;Initial Catalog=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word;
CatalogAzureStorageEnabled: "False"
IdentitySqlDb: Server=sql-data;Initial Catalog=Microsoft.eShopOnContainers.Services.IdentityDb;User Id=sa;Password=Pass@word;
LocationsBus: rabbitmq
LocationsNoSqlDb: mongodb://nosql-data
LocationsNoSqlDbName: LocationsDb
MarketingBus: rabbitmq
MarketingNoSqlDb: mongodb://nosql-data
MarketingNoSqlDbName: MarketingDb
MarketingSqlDb: Server=sql-data;Initial Catalog=Microsoft.eShopOnContainers.Services.MarketingDb;User Id=sa;Password=Pass@word;
OrderingBus: rabbitmq
OrderingSqlDb: Server=sql-data;Initial Catalog=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word;
PaymentBus: rabbitmq
UseAzureServiceBus: "False"
EnableLoadTest: "False"
basket__ConnectionString: basket-data
catalog__ConnectionString: Server=sql-data;Initial Catalog=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word;
catalog__AzureStorageEnabled: "False"
identity__ConnectionString: Server=sql-data;Initial Catalog=Microsoft.eShopOnContainers.Services.IdentityDb;User Id=sa;Password=Pass@word;
locations__ConnectionString: mongodb://nosql-data
locations__Database: LocationsDb
marketing__MongoConnectionString: mongodb://nosql-data
marketing__MongoDatabase: MarketingDb
marketing__ConnectionString: Server=sql-data;Initial Catalog=Microsoft.eShopOnContainers.Services.MarketingDb;User Id=sa;Password=Pass@word;
ordering__ConnectionString: Server=sql-data;Initial Catalog=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word;
keystore: keystore-data
GracePeriodManager_GracePeriodTime: "1"
GracePeriodManager_CheckUpdateTime: "15000"
Instrumentation_Key: ""
GracePeriodManager__GracePeriodTime: "1"
GracePeriodManager__CheckUpdateTime: "15000"
all__EventBusConnection: rabbitmq
all__InstrumentationKey: ""
all__EnableLoadTest: "False"
all__UseAzureServiceBus: "False"



68 changes: 31 additions & 37 deletions k8s/deploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ if ($buildImages) {
docker-compose -p .. -f ../docker-compose.yml build

Write-Host "Pushing images to $registry/$dockerOrg..." -ForegroundColor Yellow
$services = ("basket.api", "catalog.api", "identity.api", "ordering.api", "marketing.api","payment.api","locations.api", "webmvc", "webspa", "webstatus", "ocelotapigw")
$services = ("basket.api", "catalog.api", "identity.api", "ordering.api", "marketing.api","payment.api","locations.api", "webmvc", "webspa", "webstatus", "ocelotapigw-mm", "ocelotapigw-ms", "ocelotapigw-wm", "ocelotapigw-ws", "mobileshoppingagg", "webshoppingagg")

foreach ($service in $services) {
$imageFqdn = if ($useDockerHub) {"$dockerOrg/${service}"} else {"$registry/$dockerOrg/${service}"}
Expand Down Expand Up @@ -103,6 +103,7 @@ if (-not [string]::IsNullOrEmpty($dockerUser)) {
Write-Host "Removing existing services & deployments.." -ForegroundColor Yellow
ExecKube -cmd 'delete deployments --all'
ExecKube -cmd 'delete services --all'
ExecKube -cmd 'delete configmap internalurls'
ExecKube -cmd 'delete configmap urls'
ExecKube -cmd 'delete configmap externalcfg'
ExecKube -cmd 'delete configmap ocelot'
Expand All @@ -116,47 +117,28 @@ if ($deployInfrastructure) {

Write-Host 'Deploying ocelot APIGW' -ForegroundColor Yellow

ExecKube "create configmap ocelot --from-file=ocelot/configuration.json"
ExecKube "create configmap ocelot --from-file=mm=ocelot/configuration-mobile-marketing.json --from-file=ms=ocelot/configuration-mobile-shopping.json --from-file=wm=ocelot/configuration-web-marketing.json --from-file=ws=ocelot/configuration-web-shopping.json "
ExecKube -cmd "apply -f ocelot/deployment.yaml"
ExecKube -cmd "apply -f ocelot/service.yaml"

Write-Host 'Deploying code deployments (Web APIs, Web apps, ...)' -ForegroundColor Yellow
ExecKube -cmd 'create -f services.yaml'

ExecKube -cmd 'create -f internalurls.yaml'
ExecKube -cmd 'create configmap urls `
--from-literal=BasketUrl=http://basket `
--from-literal=BasketHealthCheckUrl=http://basket/hc `
--from-literal=CatalogUrl=http://$($externalDns)/catalog-api `
--from-literal=CatalogHealthCheckUrl=http://catalog/hc `
--from-literal=PicBaseUrl=http://$($externalDns)/catalog-api/api/v1/catalog/items/[0]/pic/ `
--from-literal=Marketing_PicBaseUrl=http://$($externalDns)/marketing-api/api/v1/campaigns/[0]/pic/ `
--from-literal=IdentityUrl=http://$($externalDns)/identity `
--from-literal=IdentityHealthCheckUrl=http://identity/hc `
--from-literal=OrderingUrl=http://ordering `
--from-literal=OrderingHealthCheckUrl=http://ordering/hc `
--from-literal=MvcClientExternalUrl=http://$($externalDns)/webmvc `
--from-literal=WebMvcHealthCheckUrl=http://webmvc/hc `
--from-literal=MvcClientOrderingUrl=http://ordering `
--from-literal=MvcClientCatalogUrl=http://catalog `
--from-literal=MvcClientBasketUrl=http://basket `
--from-literal=MvcClientMarketingUrl=http://marketing `
--from-literal=MvcClientLocationsUrl=http://locations `
--from-literal=MarketingHealthCheckUrl=http://marketing/hc `
--from-literal=WebSpaHealthCheckUrl=http://webspa/hc `
--from-literal=SpaClientMarketingExternalUrl=http://$($externalDns)/marketing-api `
--from-literal=SpaClientOrderingExternalUrl=http://$($externalDns)/ordering-api `
--from-literal=SpaClientCatalogExternalUrl=http://$($externalDns)/catalog-api `
--from-literal=SpaClientBasketExternalUrl=http://$($externalDns)/basket-api `
--from-literal=SpaClientIdentityExternalUrl=http://$($externalDns)/identity `
--from-literal=SpaClientLocationsUrl=http://$($externalDns)/locations-api `
--from-literal=LocationsHealthCheckUrl=http://locations/hc `
--from-literal=SpaClientExternalUrl=http://$($externalDns) `
--from-literal=LocationApiClient=http://$($externalDns)/locations-api `
--from-literal=MarketingApiClient=http://$($externalDns)/marketing-api `
--from-literal=BasketApiClient=http://$($externalDns)/basket-api `
--from-literal=OrderingApiClient=http://$($externalDns)/ordering-api `
--from-literal=PaymentHealthCheckUrl=http://payment/hc'

--from-literal=PicBaseUrl=http://$($externalDns)/webshoppingapigw/api/v1/c/catalog/items/[0]/pic/ `
--from-literal=Marketing_PicBaseUrl=http://$($externalDns)/webmarketingapigw/api/v1/m/campaigns/[0]/pic/ `
--from-literal=mvc_e=http://$($externalDns)/webmvc `
--from-literal=marketingapigw_e=http://$($externalDns)/webmarketingapigw `
--from-literal=webshoppingapigw_e=http://$($externalDns)/webshoppingapigw `
--from-literal=mobileshoppingagg_e=http://$($externalDns)/mobileshoppingagg `
--from-literal=webshoppingagg_e=http://$($externalDns)/webshoppingagg `
--from-literal=identity_e=http://$($externalDns)/identity `
--from-literal=spa_e=http://$($externalDns) `
--from-literal=locations_e=http://$($externalDns)/locations-api `
--from-literal=marketing_e=http://$($externalDns)/marketing-api `
--from-literal=basket_e=http://$($externalDns)/basket-api `
--from-literal=ordering_e=http://$($externalDns)/ordering-api '

ExecKube -cmd 'label configmap urls app=eshop'

Expand Down Expand Up @@ -184,7 +166,14 @@ ExecKube -cmd 'set image deployments/payment payment=${registryPath}${dockerOrg}
ExecKube -cmd 'set image deployments/webmvc webmvc=${registryPath}${dockerOrg}/webmvc:$imageTag'
ExecKube -cmd 'set image deployments/webstatus webstatus=${registryPath}${dockerOrg}/webstatus:$imageTag'
ExecKube -cmd 'set image deployments/webspa webspa=${registryPath}${dockerOrg}/webspa:$imageTag'
ExecKube -cmd 'set image deployments/ocelot ocelot=${registryPath}${dockerOrg}/ocelotapigw:$imageTag'

ExecKube -cmd 'set image deployments/mobileshoppingagg mobileshoppingagg=${registryPath}${dockerOrg}/mobileshoppingagg:$imageTag'
ExecKube -cmd 'set image deployments/webshoppingagg webshoppingagg=${registryPath}${dockerOrg}/webshoppingagg:$imageTag'

ExecKube -cmd 'set image deployments/apigwmm apigwmm=${registryPath}${dockerOrg}/ocelotapigw-mm:$imageTag'
ExecKube -cmd 'set image deployments/apigwms apigwms=${registryPath}${dockerOrg}/ocelotapigw-ms:$imageTag'
ExecKube -cmd 'set image deployments/apigwwm apigwwm=${registryPath}${dockerOrg}/ocelotapigw-wm:$imageTag'
ExecKube -cmd 'set image deployments/apigwws apigwws=${registryPath}${dockerOrg}/ocelotapigw-ws:$imageTag'

Write-Host "Execute rollout..." -ForegroundColor Yellow
ExecKube -cmd 'rollout resume deployments/basket'
Expand All @@ -197,7 +186,12 @@ ExecKube -cmd 'rollout resume deployments/payment'
ExecKube -cmd 'rollout resume deployments/webmvc'
ExecKube -cmd 'rollout resume deployments/webstatus'
ExecKube -cmd 'rollout resume deployments/webspa'
ExecKube -cmd 'rollout resume deployments/ocelot'
ExecKube -cmd 'rollout resume deployments/mobileshoppingagg'
ExecKube -cmd 'rollout resume deployments/webshoppingagg'
ExecKube -cmd 'rollout resume deployments/apigwmm'
ExecKube -cmd 'rollout resume deployments/apigwms'
ExecKube -cmd 'rollout resume deployments/apigwwm'
ExecKube -cmd 'rollout resume deployments/apigwws'

Write-Host "WebSPA is exposed at http://$externalDns, WebMVC at http://$externalDns/webmvc, WebStatus at http://$externalDns/webstatus" -ForegroundColor Yellow

Loading

0 comments on commit 5bb6759

Please sign in to comment.