mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-24 03:40:07 +02:00
chore: added healthchecks
This commit is contained in:
1 parent
bf1dcad5dc
commit
f2f0b4e195
4 files changed
+34
-2
No files matched your search
@@ -1,7 +1,9 @@
|
|||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
|
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using Microsoft.Extensions.Diagnostics.HealthChecks;
|
||||||
using WotBlitzStatisticsPro.Common;
|
using WotBlitzStatisticsPro.Common;
|
||||||
using WotBlitzStatisticsPro.Common.Model;
|
using WotBlitzStatisticsPro.Common.Model;
|
||||||
using WotBlitzStatisticsPro.GraphQl.Mutation;
|
using WotBlitzStatisticsPro.GraphQl.Mutation;
|
||||||
@@ -33,9 +35,12 @@ namespace WotBlitzStatisticsPro.GraphQl
|
|||||||
services.AddSingleton<IMongoSettings>(mongoConfig);
|
services.AddSingleton<IMongoSettings>(mongoConfig);
|
||||||
WotBlitzStatisticsLogicInstaller.ConfigureServices(services);
|
WotBlitzStatisticsLogicInstaller.ConfigureServices(services);
|
||||||
|
|
||||||
|
services.AddHealthChecks()
|
||||||
|
.AddCheck("self", () => HealthCheckResult.Healthy())
|
||||||
|
.AddMongoDb(mongoConfig.ConnectionString, tags: new[] { "services" });
|
||||||
|
|
||||||
// Add GraphQL Services
|
// Add GraphQL Services
|
||||||
services.AddGraphQLServer()
|
services.AddGraphQLServer()
|
||||||
.AddQueryType<WotBlitzStatisticsQuery>()
|
.AddQueryType<WotBlitzStatisticsQuery>()
|
||||||
.AddMutationType<WotBlitzStatisticsMutation>()
|
.AddMutationType<WotBlitzStatisticsMutation>()
|
||||||
.AddType<AccountsSearchItemObjectType>()
|
.AddType<AccountsSearchItemObjectType>()
|
||||||
@@ -53,7 +58,15 @@ namespace WotBlitzStatisticsPro.GraphQl
|
|||||||
.UseEndpoints(endpoints =>
|
.UseEndpoints(endpoints =>
|
||||||
{
|
{
|
||||||
endpoints.MapGraphQL();
|
endpoints.MapGraphQL();
|
||||||
});
|
endpoints.MapHealthChecks("/health/self", new HealthCheckOptions
|
||||||
|
{
|
||||||
|
Predicate = r => r.Tags.Contains("self")
|
||||||
|
});
|
||||||
|
endpoints.MapHealthChecks("/health/startup", new HealthCheckOptions
|
||||||
|
{
|
||||||
|
Predicate = r => r.Tags.Contains("services")
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="AspNetCore.HealthChecks.MongoDb" Version="5.0.1" />
|
||||||
<PackageReference Include="HotChocolate.AspNetCore" Version="11.0.6" />
|
<PackageReference Include="HotChocolate.AspNetCore" Version="11.0.6" />
|
||||||
<PackageReference Include="HotChocolate.AspNetCore.Authorization" Version="11.0.6" />
|
<PackageReference Include="HotChocolate.AspNetCore.Authorization" Version="11.0.6" />
|
||||||
<PackageReference Include="HotChocolate.Types.Filters" Version="11.0.6" />
|
<PackageReference Include="HotChocolate.Types.Filters" Version="11.0.6" />
|
||||||
|
|||||||
@@ -33,6 +33,21 @@ spec:
|
|||||||
name: wot-blitz-statistics-secret
|
name: wot-blitz-statistics-secret
|
||||||
key: WargamingApi__ApplicationId
|
key: WargamingApi__ApplicationId
|
||||||
image: mike/wot-blitz-statistics-pro:v1
|
image: mike/wot-blitz-statistics-pro:v1
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /health/self
|
||||||
|
port: 80
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 30
|
||||||
|
timeoutSeconds: 1
|
||||||
|
failureThreshold: 3
|
||||||
|
startupProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /health/startup
|
||||||
|
port: 80
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 30
|
||||||
|
failureThreshold: 30
|
||||||
imagePullPolicy: ""
|
imagePullPolicy: ""
|
||||||
name: wot-blitz-statististics-web
|
name: wot-blitz-statististics-web
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
@@ -12,3 +12,6 @@ spec:
|
|||||||
- name: "8040"
|
- name: "8040"
|
||||||
port: 8040
|
port: 8040
|
||||||
targetPort: 80
|
targetPort: 80
|
||||||
|
- name: "443"
|
||||||
|
port: 443
|
||||||
|
targetPort: 443
|
||||||
Reference in new issue
Block a user