DengBiao před 2 roky
rodič
revize
ed2bef7f3b
5 změnil soubory, kde provedl 18 přidání a 7 odebrání
  1. +2
    -1
      chart/templates/role/cluster_role.yaml
  2. +10
    -1
      chart/templates/server/connect.yaml
  3. +1
    -1
      chart/templates/server/logic.yaml
  4. +3
    -3
      pkg/rpc/rpc.go
  5. +2
    -1
      test/tcp_conn/main.go

+ 2
- 1
chart/templates/role/cluster_role.yaml Zobrazit soubor

@@ -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

+ 10
- 1
chart/templates/server/connect.yaml Zobrazit soubor

@@ -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

+ 1
- 1
chart/templates/server/logic.yaml Zobrazit soubor

@@ -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


+ 3
- 3
pkg/rpc/rpc.go Zobrazit soubor

@@ -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)


+ 2
- 1
test/tcp_conn/main.go Zobrazit soubor

@@ -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


Načítá se…
Zrušit
Uložit