Also I wanted to also just provide some context around our Ingress Gateway. Although TLS is possible Ingress Gateway and you could encrypt traffic sent to the Gateway using the TLS cert that is presented to you if you trust the Consul Connect CA, it is mainly meant to be utilized for service to service communication.
@david-yu I just want to describe the original problem that I was saying. So I am doing a POC on kubernetes and consul connect. I have setup consul and deployed application. But when I deployed envoy proxy. My service was unable to hit external urls such as of zookeeper or even curl google.com was unreachable from my service pod. Thats how I started exploring ingress. So should I go ahead with it or is there some other approach. Btw I am using 1.10 version of consul.
Edit: See @ishustava1’s answer below. This should work by default.
You can use the consul.hashicorp.com/transparent-proxy-exclude-outbound-cidrs or consul.hashicorp.com/transparent-proxy-exclude-outbound-ports annotations to allow access to those external URLs.
It sounds like your problem is related more to egress than ingress. Reaching external services, like google.com, should work by default. This behavior is controlled by the MeshDestinationsOnly property of the Mesh Config entry. Since it’s false by default, you should be able to reach those services through the proxy with no problem.
I’ve tried deploying it myself on kind and it worked:
@ishustava1@lkysow Thanks my problem got resolved. But there is something else I am stuck with, earlier we were using consul for service discovery. All are services are deployed in separate vm’s and interact via consul. Now we are shifting to service mesh and kubernetes. So I have successfully deployed a service A on k8 container along with side-car. Now I want to call that service A from outisde k8 that is from service B(running in one of the VMs) . How can I use name based discovery here as well(from service B to service A). Is there some documentation on the same. I am not using mtls now. So I wont be needing gateways.
The best way to do that is to use an ingress gateway. The reason you need that is two-fold. First, your networking on k8s and VMs are likely different and so adding an ingress gateway to proxy between those networks will help. Second, your services on the service mesh will require mTLS by default and there’s no way to disable that. So now if your service from VM will try to call a service on the mesh without mTLS certs, it’ll get rejected by the sidecar proxy.