Browse Source

Fixing some generic issues

features/migration-dotnet3
eiximenis 5 years ago
parent
commit
60998cbd5c
26 changed files with 156 additions and 152 deletions
  1. +3
    -0
      k8s/helm/apigwmm/templates/deployment.yaml
  2. +4
    -0
      k8s/helm/apigwmm/templates/service.yaml
  3. +13
    -0
      k8s/helm/apigwmm/values.yaml
  4. +3
    -3
      k8s/helm/apigwms/envoy.yaml
  5. +3
    -0
      k8s/helm/apigwms/templates/deployment.yaml
  6. +4
    -0
      k8s/helm/apigwms/templates/service.yaml
  7. +14
    -1
      k8s/helm/apigwms/values.yaml
  8. +3
    -0
      k8s/helm/apigwwm/templates/deployment.yaml
  9. +4
    -0
      k8s/helm/apigwwm/templates/service.yaml
  10. +14
    -1
      k8s/helm/apigwwm/values.yaml
  11. +3
    -3
      k8s/helm/apigwws/envoy.yaml
  12. +3
    -0
      k8s/helm/apigwws/templates/deployment.yaml
  13. +4
    -0
      k8s/helm/apigwws/templates/service.yaml
  14. +14
    -1
      k8s/helm/apigwws/values.yaml
  15. +4
    -4
      k8s/helm/webstatus/templates/configmap.yaml
  16. +18
    -0
      k8s/helm/webstatus/values.yaml
  17. +3
    -3
      src/ApiGateways/Envoy/config/mobileshopping/envoy.yaml
  18. +3
    -3
      src/ApiGateways/Envoy/config/webshopping/envoy.yaml
  19. +15
    -0
      src/ApiGateways/Web.Bff.Shopping/aggregator/appsettings.Development.json
  20. +8
    -8
      src/Web/WebMVC/Infrastructure/WebContextSeed.cs
  21. +10
    -7
      src/Web/WebMVC/Program.cs
  22. +0
    -2
      src/Web/WebMVC/Services/BasketService.cs
  23. +2
    -22
      src/Web/WebMVC/Startup.cs
  24. +1
    -6
      src/Web/WebMVC/appsettings.Development.json
  25. +1
    -6
      src/Web/WebMVC/appsettings.json
  26. +2
    -82
      src/Web/WebStatus/appsettings.Development.json

+ 3
- 0
k8s/helm/apigwmm/templates/deployment.yaml View File

@ -86,6 +86,9 @@ spec:
- name: http
containerPort: 80
protocol: TCP
- name: admin
containerPort: 8001
protocol: TCP
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.nodeSelector }}


+ 4
- 0
k8s/helm/apigwmm/templates/service.yaml View File

@ -14,6 +14,10 @@ spec:
targetPort: http
protocol: TCP
name: http
- port: {{ .Values.service.adminPort }}
targetPort: admin
protocol: TCP
name: admin
selector:
app: {{ template "apigwmm.name" . }}
release: {{ .Release.Name }}

+ 13
- 0
k8s/helm/apigwmm/values.yaml View File

@ -9,6 +9,7 @@ image:
service:
type: ClusterIP
port: 80
adminPort: 8001
ingress:
enabled: true
@ -30,3 +31,15 @@ env: {}
envoy:
configPath: /etc/envoy
probes:
liveness:
path: /ready
initialDelaySeconds: 5
periodSeconds: 15
port: 8001
readiness:
path: /ready
initialDelaySeconds: 5
periodSeconds: 60
port: 8001

+ 3
- 3
k8s/helm/apigwms/envoy.yaml View File

@ -35,12 +35,12 @@ static_resources:
- match:
prefix: "/o/"
route:
prefix_rewrite: "/order-api/"
prefix_rewrite: "/ordering-api/"
cluster: ordering
- match:
prefix: "/order-api/"
prefix: "/ordering-api/"
route:
cluster: catalog
cluster: ordering
- match:
prefix: "/b/"
route:


+ 3
- 0
k8s/helm/apigwms/templates/deployment.yaml View File

@ -86,6 +86,9 @@ spec:
- name: http
containerPort: 80
protocol: TCP
- name: admin
containerPort: 8001
protocol: TCP
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.nodeSelector }}


+ 4
- 0
k8s/helm/apigwms/templates/service.yaml View File

@ -14,6 +14,10 @@ spec:
targetPort: http
protocol: TCP
name: http
- port: {{ .Values.service.adminPort }}
targetPort: admin
protocol: TCP
name: admin
selector:
app: {{ template "apigwms.name" . }}
release: {{ .Release.Name }}

+ 14
- 1
k8s/helm/apigwms/values.yaml View File

@ -9,6 +9,7 @@ image:
service:
type: ClusterIP
port: 80
adminPort: 8001
ingress:
enabled: true
@ -29,4 +30,16 @@ affinity: {}
env: {}
envoy:
configPath: /etc/envoy
configPath: /etc/envoy
probes:
liveness:
path: /ready
initialDelaySeconds: 5
periodSeconds: 15
port: 8001
readiness:
path: /ready
initialDelaySeconds: 5
periodSeconds: 60
port: 8001

+ 3
- 0
k8s/helm/apigwwm/templates/deployment.yaml View File

@ -86,6 +86,9 @@ spec:
- name: http
containerPort: 80
protocol: TCP
- name: admin
containerPort: 8001
protocol: TCP
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.nodeSelector }}


+ 4
- 0
k8s/helm/apigwwm/templates/service.yaml View File

@ -14,6 +14,10 @@ spec:
targetPort: http
protocol: TCP
name: http
- port: {{ .Values.service.adminPort }}
targetPort: admin
protocol: TCP
name: admin
selector:
app: {{ template "apigwwm.name" . }}
release: {{ .Release.Name }}

+ 14
- 1
k8s/helm/apigwwm/values.yaml View File

@ -9,6 +9,7 @@ image:
service:
type: ClusterIP
port: 80
adminPort: 8001
ingress:
enabled: true
@ -30,4 +31,16 @@ affinity: {}
env: {}
envoy:
configPath: /etc/envoy
configPath: /etc/envoy
probes:
liveness:
path: /ready
initialDelaySeconds: 5
periodSeconds: 15
port: 8001
readiness:
path: /ready
initialDelaySeconds: 5
periodSeconds: 60
port: 8001

+ 3
- 3
k8s/helm/apigwws/envoy.yaml View File

@ -35,12 +35,12 @@ static_resources:
- match:
prefix: "/o/"
route:
prefix_rewrite: "/order-api/"
prefix_rewrite: "/ordering-api/"
cluster: ordering
- match:
prefix: "/order-api/"
prefix: "/ordering-api/"
route:
cluster: catalog
cluster: ordering
- match:
prefix: "/b/"
route:


+ 3
- 0
k8s/helm/apigwws/templates/deployment.yaml View File

@ -85,6 +85,9 @@ spec:
- name: http
containerPort: 80
protocol: TCP
- name: admin
containerPort: 8001
protocol: TCP
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.nodeSelector }}


+ 4
- 0
k8s/helm/apigwws/templates/service.yaml View File

@ -14,6 +14,10 @@ spec:
targetPort: http
protocol: TCP
name: http
- port: {{ .Values.service.adminPort }}
targetPort: admin
protocol: TCP
name: admin
selector:
app: {{ template "apigwws.name" . }}
release: {{ .Release.Name }}

+ 14
- 1
k8s/helm/apigwws/values.yaml View File

@ -9,6 +9,7 @@ image:
service:
type: ClusterIP
port: 80
adminPort: 8001
ingress:
enabled: true
@ -30,4 +31,16 @@ affinity: {}
env: {}
envoy:
configPath: /etc/envoy
configPath: /etc/envoy
probes:
liveness:
path: /ready
initialDelaySeconds: 5
periodSeconds: 15
port: 8001
readiness:
path: /ready
initialDelaySeconds: 5
periodSeconds: 60
port: 8001

+ 4
- 4
k8s/helm/webstatus/templates/configmap.yaml View File

@ -24,13 +24,13 @@ data:
name__spa__hc: WebSPA HTTP Check
internalurls__spa__hc: http://{{ .Values.app.svc.spa }}/hc
name__apigwws__hc: Web Shopping API GW HTTP Check
internalurls__apigwws__hc: http://{{ .Values.app.svc.webshoppingapigw }}/hc
internalurls__apigwws__hc: http://{{ .Values.app.svc.webshoppingapigw }}:8001/ready
name__apigwwm__hc: Web Marketing API GW HTTP Check
internalurls__apigwwm__hc: http://{{ .Values.app.svc.webmarketingapigw }}/hc
internalurls__apigwwm__hc: http://{{ .Values.app.svc.webmarketingapigw }}:8001/ready
name__apigwms__hc: Mobile Shopping API GW HTTP Check
internalurls__apigwms__hc: http://{{ .Values.app.svc.mobileshoppingapigw }}/hc
internalurls__apigwms__hc: http://{{ .Values.app.svc.mobileshoppingapigw }}:8001/ready
name__apigwmm__hc: Mobile Marketing API GW HTTP Check
internalurls__apigwmm__hc: http://{{ .Values.app.svc.mobilemarketingapigw }}/hc
internalurls__apigwmm__hc: http://{{ .Values.app.svc.mobilemarketingapigw }}:8001/ready
name__apigwwsagg__hc: Web Shopping Aggregator GW HTTP Check
internalurls__apigwwsagg__hc: http://{{ .Values.app.svc.webshoppingagg }}/hc
name__apigwmsagg__hc: Mobile Shopping Aggregator HTTP Check


+ 18
- 0
k8s/helm/webstatus/values.yaml View File

@ -86,6 +86,24 @@ env:
key: name__payment__hc
- name: HealthChecks-UI__HealthChecks__12__Uri
key: internalurls__payment__hc
- name: HealthChecks-UI__HealthChecks__13__Name
key: name__apigwws__hc
- name: HealthChecks-UI__HealthChecks__13__Uri
key: internalurls__apigwws__hc
- name: HealthChecks-UI__HealthChecks__14__Name
key: name__apigwwm__hc
- name: HealthChecks-UI__HealthChecks__14__Uri
key: internalurls__apigwwm__hc
- name: HealthChecks-UI__HealthChecks__15__Name
key: name__apigwms__hc
- name: HealthChecks-UI__HealthChecks__15__Uri
key: internalurls__apigwms__hc
- name: HealthChecks-UI__HealthChecks__16__Name
key: name__apigwmm__hc
- name: HealthChecks-UI__HealthChecks__16__Uri
key: internalurls__apigwmm__hc
# values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value)
values:
- name: ASPNETCORE_ENVIRONMENT


+ 3
- 3
src/ApiGateways/Envoy/config/mobileshopping/envoy.yaml View File

@ -35,12 +35,12 @@ static_resources:
- match:
prefix: "/o/"
route:
prefix_rewrite: "/order-api/"
prefix_rewrite: "/ordering-api/"
cluster: ordering
- match:
prefix: "/order-api/"
prefix: "/ordering-api/"
route:
cluster: catalog
cluster: ordering
- match:
prefix: "/b/"
route:


+ 3
- 3
src/ApiGateways/Envoy/config/webshopping/envoy.yaml View File

@ -35,12 +35,12 @@ static_resources:
- match:
prefix: "/o/"
route:
prefix_rewrite: "/order-api/"
prefix_rewrite: "/ordering-api/"
cluster: ordering
- match:
prefix: "/order-api/"
prefix: "/ordering-api/"
route:
cluster: catalog
cluster: ordering
- match:
prefix: "/b/"
route:


+ 15
- 0
src/ApiGateways/Web.Bff.Shopping/aggregator/appsettings.Development.json View File

@ -0,0 +1,15 @@
{
"Logging": {
"IncludeScopes": false,
"Debug": {
"LogLevel": {
"Default": "Debug"
}
},
"Console": {
"LogLevel": {
"Default": "Debug"
}
}
}
}

+ 8
- 8
src/Web/WebMVC/Infrastructure/WebContextSeed.cs View File

@ -2,8 +2,8 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.eShopOnContainers.WebMVC;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Serilog;
using System;
using System.IO;
using System.IO.Compression;
@ -13,9 +13,9 @@ namespace WebMVC.Infrastructure
{
public class WebContextSeed
{
public static void Seed(IApplicationBuilder applicationBuilder, IHostingEnvironment env, ILoggerFactory loggerFactory)
public static void Seed(IApplicationBuilder applicationBuilder, IHostingEnvironment env)
{
var log = loggerFactory.CreateLogger<WebContextSeed>();
var log = Serilog.Log.Logger;
var settings = (AppSettings)applicationBuilder
.ApplicationServices.GetRequiredService<IOptions<AppSettings>>().Value;
@ -39,7 +39,7 @@ namespace WebMVC.Infrastructure
string overrideCssFile = Path.Combine(contentRootPath, "Setup", "override.css");
if (!File.Exists(overrideCssFile))
{
log.LogError("Override css file '{FileName}' does not exists.", overrideCssFile);
log.Error("Override css file '{FileName}' does not exists.", overrideCssFile);
return;
}
@ -48,7 +48,7 @@ namespace WebMVC.Infrastructure
}
catch (Exception ex)
{
log.LogError(ex, "EXCEPTION ERROR: {Message}", ex.Message);
log.Error(ex, "EXCEPTION ERROR: {Message}", ex.Message);
}
}
@ -59,7 +59,7 @@ namespace WebMVC.Infrastructure
string imagesZipFile = Path.Combine(contentRootPath, "Setup", "images.zip");
if (!File.Exists(imagesZipFile))
{
log.LogError("Zip file '{ZipFileName}' does not exists.", imagesZipFile);
log.Error("Zip file '{ZipFileName}' does not exists.", imagesZipFile);
return;
}
@ -81,14 +81,14 @@ namespace WebMVC.Infrastructure
}
else
{
log.LogWarning("Skipped file '{FileName}' in zipfile '{ZipFileName}'", entry.Name, imagesZipFile);
log.Warning("Skipped file '{FileName}' in zipfile '{ZipFileName}'", entry.Name, imagesZipFile);
}
}
}
}
catch ( Exception ex )
{
log.LogError(ex, "EXCEPTION ERROR: {Message}", ex.Message);
log.Error(ex, "EXCEPTION ERROR: {Message}", ex.Message);
}
}


+ 10
- 7
src/Web/WebMVC/Program.cs View File

@ -53,15 +53,18 @@ namespace Microsoft.eShopOnContainers.WebMVC
{
var seqServerUrl = configuration["Serilog:SeqServerUrl"];
var logstashUrl = configuration["Serilog:LogstashgUrl"];
return new LoggerConfiguration()
.MinimumLevel.Verbose()
var cfg = new LoggerConfiguration()
.ReadFrom.Configuration(configuration)
.Enrich.WithProperty("ApplicationContext", AppName)
.Enrich.FromLogContext()
.WriteTo.Console()
.WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl)
.WriteTo.Http(string.IsNullOrWhiteSpace(logstashUrl) ? "http://logstash:8080" : logstashUrl)
.ReadFrom.Configuration(configuration)
.CreateLogger();
.WriteTo.Console();
if (!string.IsNullOrWhiteSpace(seqServerUrl)) {
cfg.WriteTo.Seq(seqServerUrl);
}
if (!string.IsNullOrWhiteSpace(logstashUrl)) {
cfg.WriteTo.Http(logstashUrl);
}
return cfg.CreateLogger();
}
private static IConfiguration GetConfiguration()


+ 0
- 2
src/Web/WebMVC/Services/BasketService.cs View File

@ -19,8 +19,6 @@ namespace Microsoft.eShopOnContainers.WebMVC.Services
private readonly string _basketByPassUrl;
private readonly string _purchaseUrl;
private readonly string _bffUrl;
public BasketService(HttpClient httpClient, IOptions<AppSettings> settings, ILogger<BasketService> logger)
{
_apiClient = httpClient;


+ 2
- 22
src/Web/WebMVC/Startup.cs View File

@ -46,7 +46,6 @@ namespace Microsoft.eShopOnContainers.WebMVC
.AddCustomMvc(Configuration)
.AddDevspaces()
.AddHttpClientServices(Configuration);
//.AddHttpClientLogging(Configuration) //Opt-in HttpClientLogging config
IdentityModelEventSource.ShowPII = true; // Caution! Do NOT use in production: https://aka.ms/IdentityModel/PII
@ -56,12 +55,9 @@ namespace Microsoft.eShopOnContainers.WebMVC
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Remove("sub");
//loggerFactory.AddAzureWebAppDiagnostics();
//loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace);
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
@ -75,7 +71,6 @@ namespace Microsoft.eShopOnContainers.WebMVC
if (!string.IsNullOrEmpty(pathBase))
{
loggerFactory.CreateLogger<Startup>().LogDebug("Using PATH BASE '{PathBase}'", pathBase);
app.UsePathBase(pathBase);
}
@ -87,7 +82,7 @@ namespace Microsoft.eShopOnContainers.WebMVC
app.UseMiddleware<ByPassAuthMiddleware>();
}
WebContextSeed.Seed(app, env, loggerFactory);
WebContextSeed.Seed(app, env);
app.UseRouting();
@ -201,21 +196,6 @@ namespace Microsoft.eShopOnContainers.WebMVC
return services;
}
public static IServiceCollection AddHttpClientLogging(this IServiceCollection services, IConfiguration configuration)
{
services.AddLogging(b =>
{
b.AddFilter((category, level) => true); // Spam the world with logs.
// Add console logger so we can see all the logging produced by the client by default.
b.AddConsole(c => c.IncludeScopes = true);
// Add console logger
b.AddDebug();
});
return services;
}
public static IServiceCollection AddCustomAuthentication(this IServiceCollection services, IConfiguration configuration)
{


+ 1
- 6
src/Web/WebMVC/appsettings.Development.json View File

@ -1,10 +1,5 @@
{
"Logging": {
"LogLevel": {
"Default": "Debug"
}
},
"Serilog": {
"Serilog": {
"MinimumLevel": {
"Default": "Debug"
}


+ 1
- 6
src/Web/WebMVC/appsettings.json View File

@ -15,12 +15,7 @@
"SeqServerUrl": null,
"LogstashgUrl": null,
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"Microsoft.eShopOnContainers": "Information",
"System": "Warning"
}
"Default": "Information"
}
},
"ApplicationInsights": {


+ 2
- 82
src/Web/WebStatus/appsettings.Development.json View File

@ -1,87 +1,7 @@
{
"HealthChecks-UI": {
"HealthChecks": [
{
"Name": "Ordering HTTP Check",
"Uri": "http://localhost:5102/hc"
},
{
"Name": "Ordering HTTP Background Check",
"Uri": "http://localhost:5111/hc"
},
{
"Name": "Basket HTTP Check",
"Uri": "http://localhost:5103/hc"
},
{
"Name": "Catalog HTTP Check",
"Uri": "http://localhost:5101/hc"
},
{
"Name": "Identity HTTP Check",
"Uri": "http://localhost:5105/hc"
},
{
"Name": "Marketing HTTP Check",
"Uri": "http://localhost:5110/hc"
},
{
"Name": "Locations HTTP Check",
"Uri": "http://localhost:5109/hc"
},
{
"Name": "Payments HTTP Check",
"Uri": "http://localhost:5108/hc"
},
{
"Name": "WebMVC HTTP Check",
"Uri": "http://localhost:5100/hc"
},
{
"Name": "WebSPA HTTP Check",
"Uri": "http://localhost:5104/hc"
},
{
"Name": "SignalR HTTP Check",
"Uri": "http://localhost:5112/hc"
},
{
"Name": "Mobile Shopping API GW HTTP Check",
"Uri": "http://localhost:5200/hc"
},
{
"Name": "Mobile Marketing API GW HTTP Check",
"Uri": "http://localhost:5201/hc"
},
{
"Name": "Web Shopping API GW HTTP Check",
"Uri": "http://localhost:5202/hc"
},
{
"Name": "Web Marketing API GW HTTP Check",
"Uri": "http://localhost:5203/hc"
},
{
"Name": "Mobile Shopping Aggregator HTTP Check",
"Uri": "http://localhost:5120/hc"
},
{
"Name": "Web Shopping Aggregator HTTP Check",
"Uri": "http://localhost:5121/hc"
}
],
"EvaluationTimeOnSeconds": 10,
"MinimumSecondsBetweenFailureNotifications": 60
},
"Serilog": {
"SeqServerUrl": "http://localhost:5341/",
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"Microsoft.eShopOnContainers": "Information",
"System": "Warning"
}
"Default": "Debug"
}
}
}
}

Loading…
Cancel
Save