Browse Source

updates to ocelot

pull/815/head
Eduard Tomàs 7 years ago
parent
commit
266ec51e54
4 changed files with 22 additions and 7 deletions
  1. +2
    -3
      k8s/gen-k8s-env-aks.ps1
  2. +6
    -2
      k8s/ingress.yaml
  3. +4
    -2
      src/Apigw/OcelotApiGw/Startup.cs
  4. +10
    -0
      src/Apigw/OcelotApiGw/appsettings.json

+ 2
- 3
k8s/gen-k8s-env-aks.ps1 View File

@ -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


+ 6
- 2
k8s/ingress.yaml View File

@ -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

+ 4
- 2
src/Apigw/OcelotApiGw/Startup.cs View File

@ -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();
}
}
}

+ 10
- 0
src/Apigw/OcelotApiGw/appsettings.json View File

@ -0,0 +1,10 @@
{
"Logging": {
"IncludeScopes": true,
"LogLevel": {
"Default": "Trace",
"System": "Information",
"Microsoft": "Information"
}
}
}

Loading…
Cancel
Save