I have a working setup of consul service mesh using tproxy on virtual machines. I am able to reach to service running a VM using service.virtual.consul address from another VM that is in the mesh.
I want to now connect to the external service and make it accessible inside the mesh as external.virtual.consul.
This is what I have done so far,
- Added a config entry for terminating gateway as
Kind = "terminating-gateway"
Name = "managed-service-gateway"
Services = [
{
Name = "external-service"
}
]
- Register the external service as
{
"Node": "external_service_node",
"Address": "external-service.com",
"NodeMeta": {
"external-node": "true",
"external-probe": "true"
},
"Service": {
"ID": "external_service",
"Service": "external-service",
"Port": 3306
}
}
- On a new virtual machine, I have installed consul agent, have registered it and on that machine envoy proxy is running as
consul connect envoy -gateway=terminating -register -service managed-service-gateway -- -l debug --log-path /var/log/consul/envoy_logs.txt
After all of this, I could see on the consul dashboard that the external service is now linked under the terminating gateway and in service mesh with the gateway.
When I do run dig external-service.virtual.consul, I could see a virtual IP assigned however, when I try to connect to the external service using mysql -ufoo -h external-service.virtual.consul -p, connection is hanging up with an error “Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0”. However I can connect to the underlying external service without any problems outside of the mesh.
I’ve tried adding with and without redirect-traffic on terminating gatway’s VM but no help. What am I missing?