envoyconfig: fix databroker health checks (#3706)

This commit is contained in:
Caleb Doxsey 2022-10-25 12:37:46 -06:00 committed by GitHub
parent b68dc1ff4f
commit 3f7a482815
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -67,7 +67,7 @@ func (b *Builder) BuildClusters(ctx context.Context, cfg *config.Config) ([]*env
} }
if len(authorizeURLs) > 1 { if len(authorizeURLs) > 1 {
authorizeCluster.HealthChecks = grpcHealthChecks("pomerium-authorize") authorizeCluster.HealthChecks = grpcHealthChecks("pomerium-authorize")
authorizeCluster.OutlierDetection = grpcAuthorizeOutlierDetection() authorizeCluster.OutlierDetection = grpcOutlierDetection()
} }
databrokerCluster, err := b.buildInternalCluster(ctx, cfg.Options, "pomerium-databroker", databrokerURLs, upstreamProtocolHTTP2) databrokerCluster, err := b.buildInternalCluster(ctx, cfg.Options, "pomerium-databroker", databrokerURLs, upstreamProtocolHTTP2)
@ -75,8 +75,8 @@ func (b *Builder) BuildClusters(ctx context.Context, cfg *config.Config) ([]*env
return nil, err return nil, err
} }
if len(databrokerURLs) > 1 { if len(databrokerURLs) > 1 {
authorizeCluster.HealthChecks = grpcHealthChecks("pomerium-databroker") databrokerCluster.HealthChecks = grpcHealthChecks("pomerium-databroker")
authorizeCluster.OutlierDetection = grpcAuthorizeOutlierDetection() databrokerCluster.OutlierDetection = grpcOutlierDetection()
} }
envoyAdminCluster, err := b.buildEnvoyAdminCluster(ctx, cfg) envoyAdminCluster, err := b.buildEnvoyAdminCluster(ctx, cfg)
@ -406,8 +406,8 @@ func (b *Builder) buildCluster(
return cluster.Validate() return cluster.Validate()
} }
// grpcAuthorizeOutlierDetection defines slightly more aggressive malfunction detection for authorize endpoints // grpcOutlierDetection defines slightly more aggressive malfunction detection for grpc endpoints
func grpcAuthorizeOutlierDetection() *envoy_config_cluster_v3.OutlierDetection { func grpcOutlierDetection() *envoy_config_cluster_v3.OutlierDetection {
return &envoy_config_cluster_v3.OutlierDetection{ return &envoy_config_cluster_v3.OutlierDetection{
Consecutive_5Xx: wrapperspb.UInt32(5), Consecutive_5Xx: wrapperspb.UInt32(5),
Interval: durationpb.New(time.Second * 10), Interval: durationpb.New(time.Second * 10),