Skip to content

Commit

Permalink
Started getting everything running better on k8s with certmanager
Browse files Browse the repository at this point in the history
  • Loading branch information
glennc committed Nov 7, 2019
1 parent 9b93e4d commit 71364f0
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/BlazingPizza.Orders/OrdersService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class OrdersService

public OrdersService(IConfiguration configuration)
{
Console.WriteLine($"Conn: {_configuration["Data:Connection"]}");
_configuration = configuration;
var client = new MongoClient(_configuration["Data:Connection"]);
var database = client.GetDatabase(_configuration["Data:Database"]);
Expand Down
4 changes: 4 additions & 0 deletions src/BlazingPizza.Orders/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ public static async Task Main(string[] args)

public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureAppConfiguration((context, config) =>
{
config.AddKeyPerFile("/config", true);
})
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.ConfigureKestrel(options =>
Expand Down
3 changes: 3 additions & 0 deletions src/BlazingPizza.Orders/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
"System": "Information",
"Microsoft": "Information"
}
},
"Data": {
"Connection": "mongodb://localhost:27017"
}
}
2 changes: 1 addition & 1 deletion src/BlazingPizza.Orders/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"Data": {
"Collection": "orders",
"Database": "orders",
"Connection": "mongodb://localhost:27017"
"Connection": "mongodb://ordersdata:27017"
}
}
2 changes: 1 addition & 1 deletion src/BlazingPizza.Web/HttpClientExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace BlazingPizza.Web
{
//TODO: Sort out JSON Options
//TODO: Sort out JSON Options. Presumably want to use the same stuff MVC would want.
public static class HttpClientExtensions
{
public static async Task<T> GetJsonAsync<T>(this HttpClient client, string uri)
Expand Down
5 changes: 5 additions & 0 deletions src/BlazingPizza.Web/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,10 @@
"ConsumerKey": "U9DbAaVcDPYO3RVFlDo4w",
"ConsumerSecret": "l6HWZa8F5MJmbBkGSzL6gMjgZMererT5KROxAzws9o"
}
},
"Services": {
"Menu": "http://localhost:57201",
"Orders": "http://localhost:5555",
"Auth": "http://localhost:64589"
}
}
9 changes: 4 additions & 5 deletions src/BlazingPizza.Web/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
}
},
"Services": {
"Menu": "http://localhost:57201",
"Orders": "http://localhost:5555",
"Auth": "http://localhost:64589"
"Menu": "http://menu",
"Orders": "http://orders:5555",
"Auth": "http://auth"
},
"AllowedHosts": "*",
"AuthService": "https://localhost:5053"
"AllowedHosts": "*"
}
6 changes: 6 additions & 0 deletions src/BlazingPizza.sln
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docker", "docker", "{8B0BE8
docker-compose.yml = docker-compose.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "k8s", "k8s", "{6C4047E5-1FEE-42B0-8B97-771C6109C19E}"
ProjectSection(SolutionItems) = preProject
k8s\menu.yaml = k8s\menu.yaml
k8s\web.yaml = k8s\web.yaml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
3 changes: 3 additions & 0 deletions src/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ services:
build:
context: .
dockerfile: ./BlazingPizza.Web/Dockerfile
image: blazingreg.azurecr.io/blazingpizzaweb
depends_on:
- orders
- menu
Expand All @@ -22,6 +23,7 @@ services:
build:
context: .
dockerfile: ./BlazingPizza.Orders/Dockerfile
image: blazingreg.azurecr.io/blazingpizzaorders
networks:
- backend
expose:
Expand All @@ -38,6 +40,7 @@ services:
build:
context: .
dockerfile: ./BlazingPizza.Menu/Dockerfile
image: blazingreg.azurecr.io/blazingpizzamenu
networks:
- backend
expose:
Expand Down

0 comments on commit 71364f0

Please sign in to comment.