| | |
| | | ALHost string // 算法Host |
| | | Host string // 服务Host |
| | | NodeID string // Nsq节点ID |
| | | HttpNodePort int32 // HTTP nodePort端口 |
| | | RpcNodePort int32 // RPC nodePort端口 |
| | | } |
| | | |
| | | func create_test() { |
| | |
| | | return err |
| | | } |
| | | |
| | | config.HttpPort, config.RpcPort, err = getTwoNodePort(config.Client) |
| | | config.HttpNodePort, config.RpcNodePort, err = getTwoNodePort(config.Client) |
| | | if err != nil { |
| | | return err |
| | | } |
| | |
| | | }, |
| | | }, |
| | | { |
| | | Name: "AL_HOST", |
| | | Value: config.ALHost, |
| | | }, |
| | | { |
| | | Name: "GRPC_NODE_PORT", |
| | | Value: strconv.Itoa(int(config.RpcNodePort)), |
| | | }, |
| | | { |
| | | Name: "NODE_ID", |
| | | Value: config.NodeID, |
| | | }, |
| | |
| | | }, |
| | | } |
| | | |
| | | if config.ALHost != "" { |
| | | envs = append(envs, apiv1.EnvVar{ |
| | | Name: "AL_HOST", |
| | | Value: config.ALHost, |
| | | }) |
| | | } |
| | | |
| | | if config.NodeID != "" { |
| | | envs = append(envs, apiv1.EnvVar{ |
| | | Name: "NODE_ID", |
| | | Value: config.NodeID, |
| | | }) |
| | | } |
| | | |
| | | if len(pairs) > 0 { |
| | | for name, value := range pairs { |
| | | envs = append(envs, apiv1.EnvVar{ |
| | | Name: name, |
| | | Value: value, |
| | | }) |
| | | } |
| | | } |
| | | for name, value := range pairs { |
| | | envs = append(envs, apiv1.EnvVar{ |
| | | Name: name, |
| | |
| | | { |
| | | Name: "http", |
| | | Protocol: apiv1.ProtocolTCP, |
| | | Port: port, // 集群内部访问端口 |
| | | TargetPort: intstr.FromInt(int(port)), // 容器对外端口 |
| | | NodePort: config.HttpPort, // 外部访问端口 |
| | | Port: config.HttpPort, // 集群内部访问端口 |
| | | TargetPort: intstr.FromInt(int(config.HttpPort)), // 容器对外端口 |
| | | NodePort: config.HttpNodePort, // 外部访问端口 |
| | | }, |
| | | { |
| | | Name: "tcp", |
| | | Protocol: apiv1.ProtocolTCP, |
| | | Port: rpcPort, |
| | | TargetPort: intstr.FromInt(int(rpcPort)), |
| | | NodePort: config.RpcPort, |
| | | Port: config.RpcPort, |
| | | TargetPort: intstr.FromInt(int(config.RpcPort)), |
| | | NodePort: config.RpcNodePort, |
| | | }, |
| | | }, |
| | | SessionAffinity: apiv1.ServiceAffinityClientIP, |