diff --git a/k8s/gen-k8s-env-aks.ps1 b/k8s/gen-k8s-env-aks.ps1 index 6b8449565..1be5cd2c3 100644 --- a/k8s/gen-k8s-env-aks.ps1 +++ b/k8s/gen-k8s-env-aks.ps1 @@ -3,9 +3,8 @@ [parameter(Mandatory=$true)][string]$location, [parameter(Mandatory=$false)][string]$registryName, [parameter(Mandatory=$true)][string]$serviceName, - [parameter(Mandatory=$true)][string]$dnsName, [parameter(Mandatory=$true)][string]$createAcr=$true, - [parameter(Mandatory=$false)][int]$nodeCount=2, + [parameter(Mandatory=$false)][int]$nodeCount=3, [parameter(Mandatory=$false)][string]$nodeVMSize="Standard_D2_v2" ) @@ -21,7 +20,7 @@ if ($createAcr -eq $true) { # Create kubernetes orchestrator Write-Host "Creating kubernetes orchestrator..." -ForegroundColor Yellow -az aks create --resource-group=$resourceGroupName --name=$serviceName --dns-name-prefix=$dnsName --generate-ssh-keys --node-count=$nodeCount --node-vm-size=$nodeVMSize +az aks create --resource-group=$resourceGroupName --name=$serviceName --generate-ssh-keys --node-count=$nodeCount --node-vm-size=$nodeVMSize # Retrieve kubernetes cluster configuration and save it under ~/.kube/config az aks get-credentials --resource-group=$resourceGroupName --name=$serviceName diff --git a/k8s/ingress.yaml b/k8s/ingress.yaml index 813a88a36..59012bf26 100644 --- a/k8s/ingress.yaml +++ b/k8s/ingress.yaml @@ -37,7 +37,7 @@ spec: servicePort: 80 - path: /marketing-api backend: - serviceName: marketing + serviceName: ocelot servicePort: 80 - path: /payment-api backend: @@ -51,5 +51,9 @@ spec: backend: serviceName: webspa servicePort: 80 - + - path: /ocelot + backend: + serviceName: ocelot + servicePort: 80 + diff --git a/src/Apigw/OcelotApiGw/Startup.cs b/src/Apigw/OcelotApiGw/Startup.cs index 8e99afaf2..487793eda 100644 --- a/src/Apigw/OcelotApiGw/Startup.cs +++ b/src/Apigw/OcelotApiGw/Startup.cs @@ -29,14 +29,16 @@ namespace OcelotApiGw services.AddOcelot(_cfg); } - public void Configure(IApplicationBuilder app, IHostingEnvironment env) + public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } - app.UseOcelot(); + loggerFactory.AddConsole(_cfg.GetSection("Logging")); + + app.UseOcelot().Wait(); } } } diff --git a/src/Apigw/OcelotApiGw/appsettings.json b/src/Apigw/OcelotApiGw/appsettings.json new file mode 100644 index 000000000..426750e6a --- /dev/null +++ b/src/Apigw/OcelotApiGw/appsettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "IncludeScopes": true, + "LogLevel": { + "Default": "Trace", + "System": "Information", + "Microsoft": "Information" + } + } +} \ No newline at end of file