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

add server reflection #34

Merged
merged 3 commits into from
Nov 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions cmd/entrypoints/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"github.com/lyft/flytestdlib/contextutils"
"github.com/lyft/flytestdlib/promutils/labeled"
"google.golang.org/grpc"
"google.golang.org/grpc/reflection"
)

// serveCmd represents the serve command
Expand Down Expand Up @@ -84,6 +85,9 @@ 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))
if cfg.GrpcServerReflection {
reflection.Register(grpcServer)
}
return grpcServer, nil
}

Expand Down
1 change: 1 addition & 0 deletions flyteadmin_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
server:
httpPort: 8088
grpcPort: 8089
grpcServerReflection: true
security:
secure: false
ssl:
Expand Down
11 changes: 6 additions & 5 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ const SectionKey = "server"
//go:generate pflags ServerConfig --default-var=defaultServerConfig

type ServerConfig struct {
HTTPPort int `json:"httpPort" pflag:",On which http port to serve admin"`
GrpcPort int `json:"grpcPort" pflag:",On which grpc port to serve admin"`
KubeConfig string `json:"kube-config" pflag:",Path to kubernetes client config file."`
Master string `json:"master" pflag:",The address of the Kubernetes API server."`
Security ServerSecurityOptions `json:"security"`
HTTPPort int `json:"httpPort" pflag:",On which http port to serve admin"`
GrpcPort int `json:"grpcPort" pflag:",On which grpc port to serve admin"`
GrpcServerReflection bool `json:"grpcServerReflection" pflag:",Enable GRPC Server Reflection"`
KubeConfig string `json:"kube-config" pflag:",Path to kubernetes client config file."`
Master string `json:"master" pflag:",The address of the Kubernetes API server."`
Security ServerSecurityOptions `json:"security"`
}

type ServerSecurityOptions struct {
Expand Down
1 change: 1 addition & 0 deletions pkg/config/serverconfig_flags.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions pkg/config/serverconfig_flags_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.