wfy-belief opened a new issue, #2332:
URL: https://github.com/apache/apisix-ingress-controller/issues/2332

   ### Issue description
   
   1、使用 helm 创建的 MySQL 单节点,已确认,通过 k8s service 映射端口能够成功连接。
   创建的命令为: `helm install mysql bitnami/mysql --debug --atomic --timeout 20m`
   2、创建 apisix 的 helm,使用最新版的镜像
   `helm upgrade --install apisix apisix/apisix --create-namespace  --namespace 
apisix --values=values.yaml --set dashboard.enabled=true --set 
ingress-controller.enabled=true --set 
ingress-controller.config.apisix.serviceNamespace=apisix`
   
   values 的改动点如下
   type:LoadBalancer
   TCP: 增加 3306
   ```yaml
   service:
     # -- Apache APISIX service type for user access itself
     type: LoadBalancer
     # -- Setting how the Service route external traffic
     # If you want to keep the client source IP, you can set this to Local.
   
     # ref: 
https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip
     externalTrafficPolicy: Cluster
     # type: LoadBalancer
     # annotations:
     #   service.beta.kubernetes.io/aws-load-balancer-type: nlb
     externalIPs: []
     # -- Apache APISIX service settings for http
     http:
       enabled: true
       servicePort: 80
       containerPort: 9080
       # -- Support multiple http ports, See 
[Configuration](https://github.com/apache/apisix/blob/0bc65ea9acd726f79f80ae0abd8f50b7eb172e3d/conf/config-default.yaml#L24)
       additionalContainerPorts: []
         # - port: 9081
         #   enable_http2: true          # If not set, the default value is 
`false`.
         # - ip: 127.0.0.2               # Specific IP, If not set, the default 
value is `0.0.0.0`.
         #   port: 9082
         #   enable_http2: true
     # -- Apache APISIX service settings for tls
     tls:
       servicePort: 443
       # nodePort: 4443
   
     # -- Apache APISIX service settings for stream. L4 proxy (TCP/UDP)
     stream:
       enabled: true
       tcp:
         - 3306
       udp: []
   ```
   
   创建 stream 路由
   
   ```yaml
   apiVersion: apisix.apache.org/v2
   kind: ApisixRoute
   metadata:
     name: mysql-stream-route
   spec:
     stream:
       - name: mysql-master
         protocol: TCP
         match:
           ingressPort: 3306
         backend:
           serviceName: mysql-headless
           servicePort: 3306
   ```
   
   最后执行验证,发现无法通信
   
   ```bash
   ❯ mysql -h 10.11.32.12 -P3306 -u root -p
   Enter password: 
   ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial 
communication packet', system error: 2
   ```
   
   ### Environment
   
   - your apisix-ingress-controller version (output of 
apisix-ingress-controller version --long):
   使用的最新版 1.8.0
   ```
   helm upgrade --install apisix apisix/apisix --create-namespace  --namespace 
apisix --set dashboard.enabled=true --set ingress-controller.enabled=true --set 
ingress
   -controller.config.apisix.serviceNamespace=apisix
   ```
   - your Kubernetes cluster version (output of kubectl version):
   ```bash
   Client Version: v1.31.2
   Kustomize Version: v5.4.2
   Server Version: v1.30.5+k3s1
   ```
   - if you run apisix-ingress-controller in Bare-metal environment, also show 
your OS version (uname -a):
   Ubuntu 24.04 LTS   6.8.0-40-generic   containerd://1.7.21-k3s2


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to