diff --git a/chart/templates/role/cluster_role.yaml b/chart/templates/role/cluster_role.yaml index 315227f..844f704 100644 --- a/chart/templates/role/cluster_role.yaml +++ b/chart/templates/role/cluster_role.yaml @@ -3,6 +3,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: pod-role + namespace: gim rules: - apiGroups: - "" @@ -31,4 +32,4 @@ roleRef: subjects: - kind: ServiceAccount name: default - namespace: default + namespace: gim diff --git a/chart/templates/server/connect.yaml b/chart/templates/server/connect.yaml index 7b05e49..88df932 100644 --- a/chart/templates/server/connect.yaml +++ b/chart/templates/server/connect.yaml @@ -49,6 +49,15 @@ spec: selector: app: connect ports: - - protocol: TCP + - name: rpclisten + protocol: TCP port: 8000 targetPort: 8000 + - name: tcplisten + protocol: TCP + port: 8001 + targetPort: 8001 + - name: wslisten + protocol: TCP + port: 8002 + targetPort: 8002 diff --git a/chart/templates/server/logic.yaml b/chart/templates/server/logic.yaml index 8be720b..d61eae1 100644 --- a/chart/templates/server/logic.yaml +++ b/chart/templates/server/logic.yaml @@ -18,7 +18,7 @@ spec: spec: containers: - name: logic - image: 'registry.cn-shenzhen.aliyuncs.com/fnuoos-prd/zyos-gim-logic:202209018-03' + image: 'registry.cn-shenzhen.aliyuncs.com/fnuoos-prd/zyos-gim-logic:202209018-04' imagePullPolicy: Always # 在kind中需要指定,不然会强制到远程拉取镜像,导致部署失败 ports: - containerPort: 8001 diff --git a/pkg/rpc/rpc.go b/pkg/rpc/rpc.go index 19160c3..61559ca 100644 --- a/pkg/rpc/rpc.go +++ b/pkg/rpc/rpc.go @@ -40,7 +40,7 @@ func GetBusinessIntClient() pb.BusinessIntClient { } func initLogicIntClient() { - conn, err := grpc.DialContext(context.TODO(), k8s.GetK8STarget("default", "logic", "80"), grpc.WithInsecure(), + conn, err := grpc.DialContext(context.TODO(), k8s.GetK8STarget("default", "logic", "8000"), grpc.WithInsecure(), grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"LoadBalancingPolicy": "%s"}`, roundrobin.Name))) if err != nil { panic(err) @@ -49,7 +49,7 @@ func initLogicIntClient() { } func initConnectIntClient() { - conn, err := grpc.DialContext(context.TODO(), k8s.GetK8STarget("default", "connect", "80"), grpc.WithInsecure(), + conn, err := grpc.DialContext(context.TODO(), k8s.GetK8STarget("default", "connect", "8000"), grpc.WithInsecure(), grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"LoadBalancingPolicy": "%s"}`, picker.AddrPickerName))) if err != nil { panic(err) @@ -58,7 +58,7 @@ func initConnectIntClient() { } func initBusinessIntClient() { - conn, err := grpc.DialContext(context.TODO(), k8s.GetK8STarget("default", "business", "80"), grpc.WithInsecure(), + conn, err := grpc.DialContext(context.TODO(), k8s.GetK8STarget("default", "business", "8000"), grpc.WithInsecure(), grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"LoadBalancingPolicy": "%s"}`, roundrobin.Name))) if err != nil { panic(err) diff --git a/test/tcp_conn/main.go b/test/tcp_conn/main.go index 9e5cbab..1443203 100644 --- a/test/tcp_conn/main.go +++ b/test/tcp_conn/main.go @@ -65,7 +65,8 @@ func (c *TcpClient) Output(pt pb.PackageType, requestId int64, message proto.Mes } func (c *TcpClient) Start() { - connect, err := net.Dial("tcp", "111.229.238.28:8080") + //connect, err := net.Dial("tcp", "111.229.238.28:8080") + connect, err := net.Dial("tcp", "im-tcp-connect.izhyin.com:8001") if err != nil { log.Println(err) return