apiVersion: v1
kind: Service
metadata:
  name: tidb-gateway-privatelink-zr
  labels:
    control-plane: tidb-gateway-privatelink-zr
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: "true"
    service.beta.kubernetes.io/aws-load-balancer-scheme: internal
    service.beta.kubernetes.io/aws-load-balancer-type: external
    service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: ip
    service.beta.kubernetes.io/aws-load-balancer-target-group-attributes: preserve_client_ip.enabled=true
spec:
  selector:
    control-plane: tidb-gateway-privatelink-zr
  ports:
  # To prevent users from misconfiguring the port and being unable to connect to TiDB Serverless, and to facilitate the connection, we have also opened port 3306 for access.
  - name: mysql-client-4000
    port: 4000
    protocol: TCP
    targetPort: 4000
  - name: mysql-client-3306
    port: 3306
    protocol: TCP
    targetPort: 3306
  type: LoadBalancer
