sum-elier opened a new issue, #1823:
URL: https://github.com/apache/apisix-ingress-controller/issues/1823

   ### Issue description
   
   Hello. I am trying to use K8s, gRPC, and APISIX ingress controller locally 
through Kind. I have a small toy project to play around with these and it 
currently works with Contour without issues. I am trying to migrate it to 
APISIX but I am facing issues since what used to work with Contour as ingress 
no longer does with APISIX. The error I face is related to connectivity:
   ```
   "error":"rpc error: code = Unavailable desc = connection closed before 
server preface received"
   ```
   I am starting out with K8s and so I am not sure where to begin to look for 
issues.
   I have tried to use APISIX as an Ingress or as an Gateway, and both give the 
same error. Following are the two setups for both approaches.
   
   ## Kind cluster configuration
   ```yaml
   apiVersion: kind.x-k8s.io/v1alpha4
   kind: Cluster
   featureGates:
     "GRPCContainerProbe": true
   nodes:
     - role: control-plane
       kubeadmConfigPatches:
         - |
           kind: InitConfiguration
           nodeRegistration:
             kubeletExtraArgs:
               node-labels: "ingress-ready=true"
       extraPortMappings:
         - containerPort: 30980
           hostPort: 80
         - containerPort: 30180
           hostPort: 9180
     - role: worker
     - role: worker
   ```
   
   ## As Ingress
   ### Command to install ingress controller:
   ```bash
   helm upgrade apisix apisix/apisix \
                --create-namespace \
                --namespace default \
                --set admin.nodePort=30180 \
                --set admin.type=NodePort \
                --set apisix.timezone="UTC" \
                --set dashboard.enabled=true \
                --set gateway.http.nodePort=30980 \
                --set gateway.type=NodePort \
                --set ingress-controller.config.apisix.adminAPIVersion=v3 \
                --set ingress-controller.config.apisix.serviceNamespace=default 
\
                --set ingress-controller.enabled=true \
                --atomic --install --debug
   ```
   ### Service
   ```yaml
   apiVersion: v1
   kind: Service
   metadata:
     name: todos-service
     labels:
       app.kubernetes.io/name: todos
       app.kubernetes.io/component: server
       app.kubernetes.io/instance: todos-service-default
       app.kubernetes.io/version: "0.1.0"
   spec:
     selector:
       app.kubernetes.io/name: todos
       app.kubernetes.io/component: server
     ports:
       - name: todos-app
         port: 6666
         targetPort: grpc
   ```
   ### ApisixUpstream
   ```yaml
   apiVersion: apisix.apache.org/v2
   kind: ApisixUpstream
   metadata:
     name: todos-service
     labels:
       app.kubernetes.io/name: todos
       app.kubernetes.io/component: server
       app.kubernetes.io/instance: todos-service-apisix-upstream-default
       app.kubernetes.io/version: "0.1.0"
   spec:
     scheme: grpc
   ```
   ## As Gateway API
   ### Command to install Gateway:
   ```bash
   kubectl apply -f 
https://github.com/kubernetes-sigs/gateway-api/releases/download/v0.7.0-rc1/experimental-install.yaml
   ```
   ### Command to install ingress controller:
   ```bash
   helm upgrade apisix apisix/apisix \
                --create-namespace \
                --namespace default \
                --set admin.nodePort=30180 \
                --set admin.type=NodePort \
                --set apisix.timezone="UTC" \
                --set dashboard.enabled=true \
                --set gateway.http.nodePort=30980 \
                --set gateway.type=NodePort \
                --set ingress-controller.config.apisix.adminAPIVersion=v3 \
                --set ingress-controller.config.apisix.serviceNamespace=default 
\
                --set 
ingress-controller.config.kubernetes.enableGatewayAPI=true \
                --set ingress-controller.enabled=true \
                --atomic --install --debug
   ```
   ### Service (same as ingress)
   ```yaml
   apiVersion: v1
   kind: Service
   metadata:
     name: todos-service
     labels:
       app.kubernetes.io/name: todos
       app.kubernetes.io/component: server
       app.kubernetes.io/instance: todos-service-default
       app.kubernetes.io/version: "0.1.0"
   spec:
     selector:
       app.kubernetes.io/name: todos
       app.kubernetes.io/component: server
     ports:
       - name: todos-app
         port: 6666
         targetPort: grpc
   ```
   ### Gateway
   ```yaml
   apiVersion: gateway.networking.k8s.io/v1alpha2
   kind: GatewayClass
   metadata:
     name: todos-apisix-gatewayclass
     labels:
       app.kubernetes.io/name: todos
       app.kubernetes.io/component: gateway
       app.kubernetes.io/instance: todos-gateway-class-default
       app.kubernetes.io/version: "0.1.0"
   spec:
     controllerName: apisix.apache.org/gateway-controller
   ---
   apiVersion: gateway.networking.k8s.io/v1alpha2
   kind: Gateway
   metadata:
     name: todos-gateway
     labels:
       app.kubernetes.io/name: todos
       app.kubernetes.io/component: gateway
       app.kubernetes.io/instance: todos-gateway-default
       app.kubernetes.io/version: "0.1.0"
   spec:
     gatewayClassName: todos-apisix-gatewayclass
     listeners:
       - name: grpc
         protocol: HTTP
         port: 30980
   ---
   apiVersion: gateway.networking.k8s.io/v1alpha2
   kind: GRPCRoute
   metadata:
     name: todos-grpc-route
     labels:
       app.kubernetes.io/name: todos
       app.kubernetes.io/component: gateway
       app.kubernetes.io/instance: todos-grpc-route-default
       app.kubernetes.io/version: "0.1.0"
   spec:
     parentRefs:
       - name: todos-gateway
     rules:
       - backendRefs:
           - name: todos-service
             port: 6666
   ```
   What is wrong with my configuration or where should I start looking for the 
problem(s)?
   
   ### Environment
   
   - your apisix-ingress-controller version (output of 
apisix-ingress-controller version --long): **1.6.1**.
      This was taken from `helm search repo apisix`. I am using Kind and I 
don't know much about K8s, so I don't know where to run 
`apisix-ingress-controller version --long`.
   - your Kubernetes cluster version (output of kubectl version):
      ```
      Client Version: v1.25.4
      Kustomize Version: v4.5.7
      Server Version: v1.26.3
      ```
   - if you run apisix-ingress-controller in Bare-metal environment, also show 
your OS version (uname -a): N/A
   - Helm output for `helm search repo apisix`:
      ```
     NAME                                    CHART VERSION   APP VERSION
     apisix/apisix                           1.3.1           3.2.0      
     apisix/apisix-dashboard                 0.8.0           3.0.0      
     apisix/apisix-ingress-controller        0.11.6          1.6.1      
      ```


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