Skip to content

Commit 587bfa7

Browse files
committed
simplify the config
1 parent c94ec75 commit 587bfa7

File tree

19 files changed

+104
-94
lines changed

19 files changed

+104
-94
lines changed

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"sdk": {
3-
"version": "2.1.401"
3+
"version": "2.1.403"
44
}
55
}

samples/Notifier/appsettings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"EventBus": {
3-
"Brokers": "kafka-server:9092"
2+
"Kafka": {
3+
"FQDN": "kafka-server:9092"
44
},
55
"Logging": {
66
"LogLevel": {

samples/SignalRNotifier/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
FROM microsoft/dotnet:2.1.3-aspnetcore-runtime-alpine AS base
1+
FROM microsoft/dotnet:2.1.5-aspnetcore-runtime-alpine AS base
22
WORKDIR /app
33

44
ENV ASPNETCORE_URLS http://+:5002
55
EXPOSE 5002
66

7-
FROM microsoft/dotnet:2.1.401-sdk-alpine AS build
7+
FROM microsoft/dotnet:2.1.403-sdk-alpine AS build
88
WORKDIR .
99
COPY . .
1010

samples/SignalRNotifier/Startup.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ private static IServiceProvider BuildServiceProvider(IServiceCollection services
8181
var resolver = services.BuildServiceProvider();
8282
var config = resolver.GetRequiredService<IConfiguration>();
8383
var env = resolver.GetRequiredService<IHostingEnvironment>();
84-
var kafkaOptions = config.GetSection("EventBus");
84+
var kafkaOptions = config.GetSection("Kafka");
8585
//if (env.IsDevelopment())
8686
{
87-
services.Configure<KafkaOptions>(o => { o.Brokers = kafkaOptions.GetValue<string>("Brokers"); });
87+
services.Configure<KafkaOptions>(o => { o.Fqdn = kafkaOptions.GetValue<string>("FQDN"); });
8888
}
8989
/*else
9090
{
@@ -96,7 +96,7 @@ private static IServiceProvider BuildServiceProvider(IServiceCollection services
9696
var ip = Environment.GetEnvironmentVariable($"{serviceName}_SERVICE_HOST");
9797
var port = Environment.GetEnvironmentVariable($"{serviceName}_SERVICE_PORT");
9898
99-
services.Configure<KafkaOptions>(o => { o.Brokers = $"{ip}:{port}"; });
99+
services.Configure<KafkaOptions>(o => { o.Fqdn = $"{ip}:{port}"; });
100100
}*/
101101

102102
return resolver;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"EventBus": {
3-
"Brokers": "127.0.0.1:9092"
2+
"Kafka": {
3+
"FQDN": "127.0.0.1:9092"
44
},
55
"Redis": {
6-
"Connection": "127.0.0.1:31496",
6+
"FQDN": "127.0.0.1:31496",
77
"Password": "letmein"
88
}
99
}

samples/SignalRNotifier/appsettings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"Hosts": {
44
"BasePath": "/"
55
},
6-
"EventBus": {
7-
"Brokers": "kafka-cp-kafka:9092"
6+
"Kafka": {
7+
"FQDN": "kafka-cp-kafka:9092"
88
},
99
"Redis": {
10-
"Connection": "redis-master.redis:6379",
10+
"FQDN": "redis-master.redis:6379",
1111
"Password": "letmein"
1212
},
1313
"Logging": {

samples/SignalRNotifier/k8s/signalrnotifier-dep.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ spec:
1818
env:
1919
- name: Hosts__BasePath
2020
value: /
21-
- name: EventBus__Brokers
21+
- name: EventBus__FQDN
2222
value: "kafka-cp-kafka:9092"
2323
- name: Redis__Connection
2424
value: "redis-master.redis:6379"

samples/TodoApi/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM microsoft/dotnet:2.1.3-aspnetcore-runtime-alpine AS base
1+
FROM microsoft/dotnet:2.1.5-aspnetcore-runtime-alpine AS base
22
WORKDIR /app
33

44
ARG service_version
@@ -10,7 +10,7 @@ ENV API_VERSION ${api_version:-1.0}
1010
ENV ASPNETCORE_URLS http://+:5001
1111
EXPOSE 5001
1212

13-
FROM microsoft/dotnet:2.1.401-sdk-alpine AS build
13+
FROM microsoft/dotnet:2.1.403-sdk-alpine AS build
1414
WORKDIR .
1515
COPY . .
1616

samples/TodoApi/appsettings.Development.json

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
{
2-
"ConnectionStrings": {
3-
"mssqldb": "Server=tcp:127.0.0.1,1433;Database=maindb;User Id=cs;Password=P@ssw0rd;",
4-
"mysqldb": "server=127.0.0.1;port=30584;uid=root;pwd=P@ssw0rd;database=maindb"
5-
},
62
"Hosts": {
73
"Externals": {
84
"CurrentUri": "http://localhost:5001"
95
}
106
},
11-
"EventBus": {
12-
"Brokers": "127.0.0.1:9092"
7+
"MySqlDb": {
8+
"FQDN": "127.0.0.1:30584",
9+
"Database": "maindb",
10+
"UserName": "root",
11+
"Password": "P@ssw0rd",
12+
"Major": 5,
13+
"Minor": 7,
14+
"Build": 14,
15+
"DbType": 0
16+
},
17+
"Kafka": {
18+
"FQDN": "127.0.0.1:9092"
1319
},
1420
"Redis": {
15-
"Connection": "127.0.0.1:31496",
21+
"FQDN": "127.0.0.1:31496",
1622
"Password": "letmein"
1723
},
1824
"Logging": {

samples/TodoApi/appsettings.json

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,36 @@
22
"API_VERSION": "1.0",
33
"SERVICE_VERSION": "0.0.1",
44
"QualifiedAssemblyPattern": "NetCoreKit.Samples.*",
5+
"Hosts": {
6+
"BasePath": "/",
7+
"Externals": {
8+
"CurrentUri": "http://localhost:32501"
9+
}
10+
},
511
"ConnectionStrings": {
6-
"mysqldb": "server={0};port={1};uid={2};pwd={3};database={4}"
12+
"MsSqlDb": "Server=tcp:{0},{1};Database={2};User Id={3};Password={4};",
13+
"MySqlDb": "server={0};port={1};uid={2};pwd={3};database={4}"
714
},
8-
"k8s": {
9-
"mysqldb": {
10-
"ServiceName": "mysql",
11-
"Database": "maindb",
12-
"UserName": "root",
13-
"Password": "P@ssw0rd",
14-
"Major": 5,
15-
"Minor": 7,
16-
"Build": 14,
17-
"DbType": 0
18-
}
15+
"MySqlDb": {
16+
"FQDN": "mysql.default:3306",
17+
"Database": "maindb",
18+
"UserName": "root",
19+
"Password": "P@ssw0rd",
20+
"Major": 5,
21+
"Minor": 7,
22+
"Build": 14,
23+
"DbType": 0
1924
},
2025
"OpenApi": {
2126
"Enabled": true,
2227
"EnabledUI": true,
23-
"EnabledProfiler": true
24-
},
25-
"Hosts": {
26-
"BasePath": "/",
27-
"Externals": {
28-
"CurrentUri": "http://localhost:32501"
29-
}
28+
"EnabledProfiler": true
3029
},
31-
"EventBus": {
32-
"Brokers": "kafka-cp-kafka:9092"
30+
"Kafka": {
31+
"FQDN": "kafka-cp-kafka:9092"
3332
},
3433
"Redis": {
35-
"Connection": "redis-master.redis:6379",
34+
"FQDN": "redis-master.redis:6379",
3635
"Password": "letmein"
3736
},
3837
"Logging": {

0 commit comments

Comments
 (0)