edgemesh icon indicating copy to clipboard operation
edgemesh copied to clipboard

edgemesh gateway unable to find the service in another namespace

Open vikarna opened this issue 3 years ago • 5 comments

What happened: kubectl logs -n kubeedge edgemesh-gateway-6c649d89fb-sgcdf E0316 15:23:06.652338 1 http.go:77] route by http request uri err: service bound to the destination default.zbl-internal-nginx-service.zbl does not exist, reason: service "zbl-internal-nginx-service.zbl" not found E0316 15:45:35.721900 1 http.go:77] route by http request uri err: service bound to the destination default.zbl-internal-nginx-service.zbl.svc.cluster.local does not exist, reason: service "zbl-internal-nginx-service.zbl.svc.cluster.local" not found E0316 15:45:39.561912 1 http.go:77] route by http request uri err: service bound to the destination default.zbl-internal-nginx-service.zbl.svc.cluster.local does not exist, reason: service "zbl-internal-nginx-service.zbl.svc.cluster.local" not found E0316 15:45:40.461874 1 http.go:77] route by http request uri err: service bound to the destination default.zbl-internal-nginx-service.zbl.svc.cluster.local does not exist, reason: service "zbl-internal-nginx-service.zbl.svc.cluster.local" not found E0316 15:50:01.748800 1 http.go:77] route by http request uri err: service bound to the destination default.zbl-internal-nginx-service.zbl.svc.cluster.local does not exist, reason: service "zbl-internal-nginx-service.zbl.svc.cluster.local" not found What you expected to happen: should be able to find the service and gateway should work How to reproduce it (as minimally and precisely as possible): create a gateway in default ns and service in another namespace Anything else we need to know?:

Environment:

  • EdgeMesh version: v1.19.3-kubeedge-v1.8.1
  • Kubernetes version (use kubectl version):v1.21.0
  • KubeEdge version(e.g. cloudcore --version and edgecore --version):

Other details:

When i do curl 192.168.15.20:23333 and check the edgemesh-gateway logs E0316 15:45:40.461874 1 http.go:77] route by http request uri err: service bound to the destination default.zbl-internal-nginx-service.zbl.svc.cluster.local does not exist, reason: service "zbl-internal-nginx-service.zbl.svc.cluster.local" not found E0316 15:50:01.748800 1 http.go:77] route by http request uri err: service bound to the destination default.zbl-internal-nginx-service.zbl.svc.cluster.local does not exist, reason: service "zbl-internal-nginx-service.zbl.svc.cluster.local" not found

# kubectl get svc -n zbl zbl-internal-nginx-service NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE zbl-internal-nginx-service ClusterIP 10.98.158.67 12345/TCP 3h26m

virtual service apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: edgemesh-gateway-svc spec: gateways: - edgemesh-gateway hosts: - '*' http: - match: - uri: prefix: / route: - destination: host: zbl-internal-nginx-service.zbl.svc.cluster.local port: number: 12345_

I am able to curl the service from test pod

kubectl exec -it alpine-test curl zbl-internal-nginx-service.zbl.svc.cluster.local:12345 kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.

ZBL

vikarna avatar Mar 16 '22 16:03 vikarna

Could you print your gateway yaml?

Poorunga avatar Mar 17 '22 07:03 Poorunga

apiVersion: networking.istio.io/v1alpha3 kind: Gateway metadata: name: edgemesh-gateway spec: selector: kubeedge: edgemesh-gateway servers: - hosts: - '*' port: name: http-0 number: 23333 protocol: HTTP

vikarna avatar Mar 17 '22 07:03 vikarna

Your gateway, virtualService, service need in the same k8s namespaces

Poorunga avatar Mar 18 '22 10:03 Poorunga

ok. Is there any plan to develop this feature?

vikarna avatar Mar 21 '22 13:03 vikarna

May I ask why to constrain the namesapce of service to be the same as of the gateway? This desgin results that the host field in the virtualService can only be filled with a serviceName and a FQDN will fail.

sdghchj avatar Mar 22 '22 02:03 sdghchj