k8sgateway / k8sgateway

The Cloud-Native API Gateway and AI Gateway
https://k8sgateway.io/
Apache License 2.0
4.12k stars 449 forks source link

gRPC upstream example doesn't work #9556

Open htech7x opened 5 months ago

htech7x commented 5 months ago

Version

1.16.x (latest)

Describe the requested changes

Example from https://docs.solo.io/gloo-edge/main/guides/traffic_management/destination_types/grpc/simple-routing doesn't work.

How to see the issue:

  1. Deploy Gloo EE 1.16.x:
    helm install gloo glooe/gloo-ee --version 1.16.9 --namespace gloo-system --create-namespace --set-string license_key=$GLOO_LICENSE_KEY 
  2. Follow "step 1, 2 ,3" from the provided documentation
  3. According to the "step 4" proto descriptor should be added to the YAMl file, but it is empty
kubectl get upstream -n gloo-system default-grpcstore-demo-80 -o yaml

apiVersion: gloo.solo.io/v1
kind: Upstream
metadata:
  creationTimestamp: "2024-05-30T14:13:42Z"
  generation: 4
  labels:
    discovered_by: kubernetesplugin
    discovery.solo.io/function_discovery: enabled
  name: default-grpcstore-demo-80
  namespace: gloo-system
  resourceVersion: "28138929"
  uid: 03958bdd-bf32-4ead-b38b-afe2f0124443
spec:
  discoveryMetadata:
    labels:
      app: grpcstore-demo
  kube:
    selector:
      app: grpcstore-demo
    serviceName: grpcstore-demo
    serviceNamespace: default
    servicePort: 80
    serviceSpec:
      grpc: {}              # <-- this line
status:
  statuses:
    gloo-system:
      reportedBy: gloo
      state: 1

From the "discovery" pod logs:

{"level":"error","ts":"2024-05-29T19:49:08.140Z","logger":"fds.v1.event_loop.fds.function-discovery-updater","caller":"fds/updater.go:366","msg":"Error doing discovery *grpc.GraphqlSchemaDiscovery: context canceled","version":"undefined","stacktrace":"github.com/solo-io/gloo/projects/discovery/pkg/fds.(*updaterUpdater).Run.func3\n\t/go/pkg/mod/github.com/solo-io/gloo@v1.15.19/projects/discovery/pkg/fds/updater.go:366"}
{"level":"info","ts":"2024-05-29T19:49:08.161Z","logger":"uds.v1.event_loop.uds.v1.event_loop.syncer","caller":"discovery/discovery.go:154","msg":"reconciled upstreams","version":"undefined","discovered_by":"kubernetesplugin","upstreams":22}
{"level":"info","ts":"2024-05-29T19:49:08.161Z","logger":"uds.v1.event_loop.uds.v1.event_loop.syncer","caller":"syncer/discovery_syncer.go:43","msg":"end sync 17165918142936690605","version":"undefined"}
{"level":"warn","ts":"2024-05-29T19:49:08.200Z","logger":"fds.v1.event_loop.fds.function-discovery-updater","caller":"grpc-graphql/grpc_reflection.go:130","msg":"Unable to create GraphQLApis from gRPC reflection for upstream gloo-system in namespace default-grpcstore-demo-80: name:\"default-grpcstore-demo-80\" namespace:\"gloo-system\" exists","version":"undefined"}
...

Link to any relevant existing docs

No response

Browser Information

No response

Additional Context

Raised in Slack here

day0ops commented 4 months ago

Ran in to this very issue when udsOptions.enabled=true is set and fdsOptions.graphqlEnabled=false is not set.