File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ namespace Aspire.Hosting;
99public static class FlagdBuilderExtensions
1010{
1111 private const int FlagdPort = 8013 ;
12+ private const int HealthCheckPort = 8014 ;
1213
1314 /// <summary>
1415 /// Adds a flagd container to the application model.
@@ -34,6 +35,8 @@ public static IResourceBuilder<FlagdResource> AddFlagd(
3435 . WithImage ( FlagdContainerImageTags . Image , FlagdContainerImageTags . Tag )
3536 . WithImageRegistry ( FlagdContainerImageTags . Registry )
3637 . WithHttpEndpoint ( port : port , targetPort : FlagdPort , name : FlagdResource . HttpEndpointName )
38+ . WithHttpEndpoint ( null , HealthCheckPort , FlagdResource . HealthCheckEndpointName )
39+ . WithHttpHealthCheck ( "/healthz" , endpointName : FlagdResource . HealthCheckEndpointName )
3740 . WithBindMount ( fileSource , "/flags" )
3841 . WithArgs ( "start" , "--uri" , "file:./flags/flagd.json" ) ;
3942 }
Original file line number Diff line number Diff line change @@ -10,14 +10,22 @@ namespace Aspire.Hosting.ApplicationModel;
1010public class FlagdResource ( string name ) : ContainerResource ( name ) , IResourceWithConnectionString
1111{
1212 internal const string HttpEndpointName = "http" ;
13+ internal const string HealthCheckEndpointName = "health" ;
1314
1415 private EndpointReference ? _primaryEndpointReference ;
1516
17+ private EndpointReference ? _healthCheckEndpointReference ;
18+
1619 /// <summary>
1720 /// Gets the primary HTTP endpoint for the flagd server.
1821 /// </summary>
1922 public EndpointReference PrimaryEndpoint => _primaryEndpointReference ??= new ( this , HttpEndpointName ) ;
2023
24+ /// <summary>
25+ /// Gets the health check HTTP endpoint for the flagd server.
26+ /// </summary>
27+ public EndpointReference HealthCheckEndpoint => _healthCheckEndpointReference ??= new ( this , HealthCheckEndpointName ) ;
28+
2129 /// <summary>
2230 /// Gets the connection string expression for the flagd server.
2331 /// </summary>
You can’t perform that action at this time.
0 commit comments