diff --git a/cmd/skytest/README.md b/cmd/skytest/README.md index 8544881..b159978 100644 --- a/cmd/skytest/README.md +++ b/cmd/skytest/README.md @@ -29,7 +29,7 @@ skylb/bazel-bin/cmd/skylb/linux_amd64_stripped/skylb --etcd-endpoints="http://lo 1. 注册到skylbserver ``` -skylb-apiv2/bazel-bin/cmd/skytest/skytest-server_/skytest-server -within-k8s=true -port=18000 -skylb-endpoints="127.0.0.1:1900" -alsologtostderr -v=2 -log_dir=. +skylb-apiv2/bazel-bin/cmd/skytest/skytest-server_/skytest-server -port=18000 -skylb-endpoints="127.0.0.1:1900" -alsologtostderr -v=2 -log_dir=. ``` 2. 不注册到skylbserver diff --git a/cmd/skytest/client.go b/cmd/skytest/client.go index 0b4f5e1..e0516f4 100644 --- a/cmd/skytest/client.go +++ b/cmd/skytest/client.go @@ -38,8 +38,9 @@ var ( func startSkylb(sid vexpb.ServiceId) (skylb.ServiceCli, pb.SkytestClient, hpb.HealthClient) { skycli := skylb.NewServiceCli(vexpb.ServiceId_SHARED_TEST_CLIENT_SERVICE) - skycli.Resolve(skylb.NewServiceSpec(skylb.DefaultNameSpace, sid, skylb.DefaultPortName), - grpc.WithDefaultServiceConfig(`{"loadBalancingConfig": [{"round_robin": {}}]}`)) + options := []grpc.DialOption{} + // options = append(options, grpc.WithDefaultServiceConfig(`{"loadBalancingConfig": [{"round_robin": {}}]}`)) + skycli.Resolve(skylb.NewServiceSpec(skylb.DefaultNameSpace, sid, skylb.DefaultPortName), options...) skycli.EnableHistogram() var cli pb.SkytestClient var healthCli hpb.HealthClient diff --git a/server/server.go b/server/server.go index a506317..886d022 100644 --- a/server/server.go +++ b/server/server.go @@ -213,11 +213,11 @@ func startHTTPServer(lis net.Listener, mux *http.ServeMux) { } func start0(hostAddr string, servicePort int, spec *pb.ServiceSpec, interceptors ...grpc.UnaryServerInterceptor) (net.Listener, *grpc.Server) { - if *withinK8s { - glog.Infoln("Inside k8s, starting load reporter.") + if !*withinK8s { + glog.Infoln("Outside k8s, starting load reporter.") go StartSkylbReportLoad(spec, servicePort) } else { - glog.Warningln("WARNING: Outside k8s, load-reporting disabled.") + glog.Warningln("WARNING: Inside k8s, load-reporting disabled.") } lis, err := net.Listen("tcp", hostAddr)