diff --git a/src/Libraries/Microsoft.Extensions.Diagnostics.Probes/Microsoft.Extensions.Diagnostics.Probes.csproj b/src/Libraries/Microsoft.Extensions.Diagnostics.Probes/Microsoft.Extensions.Diagnostics.Probes.csproj index ec89a44f3b8..529a9c73fa2 100644 --- a/src/Libraries/Microsoft.Extensions.Diagnostics.Probes/Microsoft.Extensions.Diagnostics.Probes.csproj +++ b/src/Libraries/Microsoft.Extensions.Diagnostics.Probes/Microsoft.Extensions.Diagnostics.Probes.csproj @@ -1,7 +1,7 @@  Microsoft.Extensions.Diagnostics.Probes - Provides support for environmental probes. + Provides support for Kubernetes TCP health probes. Resilience diff --git a/src/Libraries/Microsoft.Extensions.Diagnostics.Probes/README.md b/src/Libraries/Microsoft.Extensions.Diagnostics.Probes/README.md index 910adeabc39..8d6670a1d25 100644 --- a/src/Libraries/Microsoft.Extensions.Diagnostics.Probes/README.md +++ b/src/Libraries/Microsoft.Extensions.Diagnostics.Probes/README.md @@ -1,6 +1,6 @@ # Microsoft.Extensions.Diagnostics.Probes -Provides support for environmental probes. +Answers Kubernetes liveness, startup, and readiness TCP probes based on the results from the [Health Checks service](https://learn.microsoft.com/aspnet/core/host-and-deploy/health-checks). ## Install the package @@ -18,6 +18,30 @@ Or directly in the C# project file: ``` +## Usage Example + +The health check endpoints can be registered and configured with the following methods: + +```csharp +public static IServiceCollection AddKubernetesProbes(this IServiceCollection services) +public static IServiceCollection AddKubernetesProbes(this IServiceCollection services, IConfigurationSection section) +public static IServiceCollection AddKubernetesProbes(this IServiceCollection services, Action configure) +``` + +Each type of probe handler can have its details configured separately. + +```csharp +services.AddKubernetesProbes(options => +{ + options.LivenessProbe.TcpPort = 2305; + options.StartupProbe.TcpPort = 2306; + options.ReadinessProbe.TcpPort = 2307; +}) +``` + +The `HealthAssessmentPeriod` property defines how often the health-checks are assessed. By default 30 seconds. + +Each probe can also specify `Func? FilterChecks` to customize which health checks are run. ## Feedback & Contributing