Skip to content

Commit

Permalink
making k8s work (Fixing Conul Addresses)
Browse files Browse the repository at this point in the history
  • Loading branch information
Radoslav Radev committed Apr 4, 2024
1 parent 2373d90 commit 7d448d1
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Backend/Account/ConsulRegisterer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static void Register(IApplicationBuilder app, IWebHostEnvironment env, IH

var serviceCheck = new AgentServiceCheck()
{
HTTP = $"https://{serviceIp}:{configuration.GetValue<string>("servicePort")}/health",
HTTP = $"http://{serviceIp}:{configuration.GetValue<string>("servicePort")}/health",
Interval = TimeSpan.FromSeconds(30),
};

Expand Down
5 changes: 4 additions & 1 deletion Backend/RecommendationAlgo/ConsulRegisterer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ public static void Register(IApplicationBuilder app, IWebHostEnvironment env, IH
string serviceIp = Environment.GetEnvironmentVariable("POD_IP") ?? configuration.GetValue<string>("POD_IP"); //gets the pod ip from the environment variable {"POD_IP"} injected by kubernetes inside of the docker container passed to the app or fallback to the appsettings.json



var consulClient = new ConsulClient(x => x.Address = new Uri(configuration.GetValue<string>("consulUri")));

var serviceCheck = new AgentServiceCheck()
{
HTTP = $"https://{serviceIp}:{configuration.GetValue<string>("servicePort")}/health",
HTTP = $"http://{serviceIp}:{configuration.GetValue<string>("servicePort")}/health",
Interval = TimeSpan.FromSeconds(30),
};

Console.WriteLine("MYHealthCheck: " + serviceCheck.HTTP);

var registration = new AgentServiceRegistration()
{
ID = serviceId,
Expand Down
2 changes: 1 addition & 1 deletion Backend/Render/ConsulRegisterer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static void Register(IApplicationBuilder app, IWebHostEnvironment env, IH

var serviceCheck = new AgentServiceCheck()
{
HTTP = $"https://{serviceIp}:{configuration.GetValue<string>("servicePort")}/health",
HTTP = $"http://{serviceIp}:{configuration.GetValue<string>("servicePort")}/health",
Interval = TimeSpan.FromSeconds(30),
};

Expand Down
2 changes: 1 addition & 1 deletion Backend/Upload/ConsulRegisterer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static void Register(IApplicationBuilder app, IWebHostEnvironment env, IH

var serviceCheck = new AgentServiceCheck()
{
HTTP = $"https://{serviceIp}:{configuration.GetValue<string>("servicePort")}/health",
HTTP = $"http://{serviceIp}:{configuration.GetValue<string>("servicePort")}/health",
Interval = TimeSpan.FromSeconds(30),
};

Expand Down
2 changes: 1 addition & 1 deletion Backend/VideoLibrary/ConsulRegisterer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static void Register(IApplicationBuilder app, IWebHostEnvironment env, IH

var serviceCheck = new AgentServiceCheck()
{
HTTP = $"https://{serviceIp}:{configuration.GetValue<string>("servicePort")}/health",
HTTP = $"http://{serviceIp}:{configuration.GetValue<string>("servicePort")}/health",
Interval = TimeSpan.FromSeconds(30),
};

Expand Down
2 changes: 1 addition & 1 deletion Backend/VideoStreamer/ConsulRegisterer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static void Register(IApplicationBuilder app, IWebHostEnvironment env, IH

var serviceCheck = new AgentServiceCheck()
{
HTTP = $"https://{serviceIp}:{configuration.GetValue<string>("servicePort")}/health",
HTTP = $"http://{serviceIp}:{configuration.GetValue<string>("servicePort")}/health",
Interval = TimeSpan.FromSeconds(30),
};

Expand Down

0 comments on commit 7d448d1

Please sign in to comment.