Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Support gRPC health checking
Browse files Browse the repository at this point in the history
This addresses flyteorg/flyte#489.

For now only server level health checking is supported but we could
extend to service level when needed later.
  • Loading branch information
honnix committed Aug 28, 2020
1 parent b075114 commit 302b0e4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/entrypoints/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import (
"github.com/lyft/flyteadmin/pkg/server"
"github.com/pkg/errors"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/health"
"google.golang.org/grpc/health/grpc_health_v1"

"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/lyft/flyteadmin/pkg/common"
Expand Down Expand Up @@ -90,6 +92,11 @@ func newGRPCServer(ctx context.Context, cfg *config.ServerConfig, authContext in
grpcServer := grpc.NewServer(serverOpts...)
grpc_prometheus.Register(grpcServer)
flyteService.RegisterAdminServiceServer(grpcServer, adminservice.NewAdminServer(cfg.KubeConfig, cfg.Master))

healthServer := health.NewServer()
healthServer.SetServingStatus("", grpc_health_v1.HealthCheckResponse_SERVING)
grpc_health_v1.RegisterHealthServer(grpcServer, healthServer)

if cfg.GrpcServerReflection {
reflection.Register(grpcServer)
}
Expand Down

0 comments on commit 302b0e4

Please sign in to comment.