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

Commit

Permalink
Grpc health checking (#118)
Browse files Browse the repository at this point in the history
* Delete and ignore vim swap file

* Support gRPC health checking

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 authored Aug 28, 2020
1 parent 6985f7a commit bf159e5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Binary file removed .Makefile.swp
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.DS_Store
.vscode/
.vendor-new/
.swp

vendor/
node_modules/
Expand Down
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 bf159e5

Please sign in to comment.