Hi All,
My consul mesh version: 1.16.x with API Gateway enabled.
I’ve defined a Kubernetes external service (type = ExternalName) namely: external-route that points to external resource.
I’ve created a HttpRoute and attaches it to my internal-api-gateway (under namespace consul) like this:
The route accepted, synced but the backend is not found as seen (external-svc is the namespace) but it’s there.
message: ‘external-svc/external-route: backend not found’
observedGeneration: 1
reason: BackendNotFound
I have no issue creating HttpRoute and attaches to the gateway for real service (clusterip). It’s just that the external service that I run into this issue.
I was wondering if it is even supported.
If anyone has had it worked please show me the steps.
You should be able to accomplish this by using a MeshService resource (docs) for your backendRef – which points explicitly to a Consul service – rather than a Kubernetes Service, which does a service lookup in Consul based on the metadata from the Kubernetes Service, which doesn’t exist in this case.
The HTTPRoute would then look similar to the one in this guide, omitting the bits about a peer, assuming your external service is registered in the same Consul cluster as your API gateway.
Hi Nathan,
Happy to report that the solution worked. One thing the document didn’t say is that we have to create a Terminating Gateway for the Consul service (catalog service)
Thank you, again for your help!