diff --git a/cmd/polaris-controller/app/polaris-controller-manager.go b/cmd/polaris-controller/app/polaris-controller-manager.go index 1a32a617..d312f24d 100644 --- a/cmd/polaris-controller/app/polaris-controller-manager.go +++ b/cmd/polaris-controller/app/polaris-controller-manager.go @@ -190,7 +190,9 @@ func initControllerConfig(s *options.KubeControllerManagerOptions) { polarisServerAddress = strings.TrimSpace(polarisServerAddress) polarisapi.PolarisHttpURL = "http://" + polarisServerAddress + ":" + strconv.Itoa(flags.httpPort) polarisapi.PolarisGrpc = polarisServerAddress + ":" + strconv.Itoa(flags.grpcPort) - log.Infof("[Manager] polaris http address %s, grpc address %s", polarisapi.PolarisHttpURL, polarisapi.PolarisGrpc) + polarisapi.PolarisConfigGrpc = polarisServerAddress + ":8093" + log.Infof("[Manager] polaris http address %s, discover grpc address %s, config grpc address %s", + polarisapi.PolarisHttpURL, polarisapi.PolarisGrpc, polarisapi.PolarisConfigGrpc) // 设置北极星开启鉴权之后,需要使用的访问token polarisapi.PolarisAccessToken = config.ServiceSync.PolarisAccessToken polarisapi.PolarisOperator = config.ServiceSync.Operator diff --git a/pkg/controller/configmap.go b/pkg/controller/configmap.go index f5466650..4dadb072 100644 --- a/pkg/controller/configmap.go +++ b/pkg/controller/configmap.go @@ -282,7 +282,7 @@ func (p *PolarisController) onConfigMapDelete(cur interface{}) { } func (p *PolarisController) watchPolarisConfig() error { - conn, err := grpc.Dial(polarisapi.PolarisGrpc, grpc.WithTransportCredentials(insecure.NewCredentials())) + conn, err := grpc.Dial(polarisapi.PolarisConfigGrpc, grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { return err } diff --git a/pkg/controller/controller.go b/pkg/controller/controller.go index ecc0d3f9..9d0d625f 100644 --- a/pkg/controller/controller.go +++ b/pkg/controller/controller.go @@ -199,7 +199,6 @@ func NewPolarisController( p.provider = providerAPI p.config = config - return p, p.watchPolarisConfig() } diff --git a/pkg/polarisapi/service_api.go b/pkg/polarisapi/service_api.go index f22f506e..3e1afe8d 100644 --- a/pkg/polarisapi/service_api.go +++ b/pkg/polarisapi/service_api.go @@ -39,6 +39,7 @@ import ( var ( PolarisHttpURL = "http://127.0.0.1:8090" PolarisGrpc = "127.0.0.1:8091" + PolarisConfigGrpc = "127.0.0.1:8093" PolarisAccessToken = "" PolarisOperator = "" )