-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation - Transparent proxy + terminating gateway #1486
Comments
Hi @mr-miles Could you provide details on how you are configuring the terminating Gateway via CRD? Btw with the new TProxy enhancements in Terminating Gateway no longer require you to register the service you are trying to dial with Consul and you would need to leverage some new configuration in ServiceDefaults instead: https://www.consul.io/docs/connect/config-entries/service-defaults#terminating-gateway-destination. I realize the docs are a little confusing and we probably need to update related Terminating GW docs elsewhere to show when to use this new config. |
Thanks @david-yu for the quick response - I was not aware of that service-defaults usage. And yes, currently I'm registering the destinations as services. So do the destination addresses have any interaction with the SNI setting on the terminating-gateway resource? And lastly, will the transparent proxy pick up calls to the given addresses (so my container continues to use "example.com" and it is all routed magically) or is a specific hostname needed (like example-https.virtual.consul)? Keen to give it a go but currently stuck on 1.11.x because of hashicorp/consul#14514 and the grpc tls issue (which I'm hoping is fixed in 1.13.2 soon)... (for clarity we were using 1.13 in our investigation up, but then found the certificate problems and had to pause/downgrade) |
@david-yu - now on 1.13 and trying to use those TProxy enhancements to terminating gateway to set up a destination. Is there a full working example anywhere to look at? So far I have:
But the virtual IP of the destination is not appearing in my envoy config. Stumped about what else to try... |
Hello, I'm not sure if it's the right issue to add to, but I've tried following the official documentation https://developer.hashicorp.com/consul/docs/k8s/connect/terminating-gateways (almost) exactly and I can't quite get the Terminating Gateway to work, at least on 1.0.1 version of the chart (utilising consul 1.14.1), which is pretty recent. Whether transparent proxy is enabled or not, and whether I use service-defaults or explicit external service registration, the traffic does not seem to go through Terminating Gateway at all. Note that on this same setup service-to-service and Ingress Gateway communication work fine. I'm specifically testing the example.com external site as in the tutorial. In both cases (connecting via sidecar localhost:1234 or using TP http://example.com) I do not get a valid or expected response. Has anyone managed to follow that example and also double-checked that if you add an explicit deny intention, or... scale terminating gateway to 0, you get a different result? One possible difference: I'm installing and configuring everything in k8s "consul" namespace, not default, however afaik in Consul OSS this is ignored (in terms of functionality). Some random observations:
and a filter:
I don't quite see the address of the Terminating Gateway anywhere. Should I? |
@krzysztof-bronk In order to block access to destinations that are not registered in Consul, you need to set The address of the terminating gateway should be visible in If you're using the Do you mind sharing the relevant configuration from the terminating gateway so that we can see if it is correctly being configured to route to this external destination? |
@blake So it's not possible to use the
What I mean is using |
@inisitijitty You can use the service name if you explicitly register the service into Consul's catalog. Instructions for doing this are documented on https://developer.hashicorp.com/consul/docs/k8s/connect/terminating-gateways#register-external-services-with-consul under the tab "Using Consul catalog." Applications in the mesh can then connect to the external service with tproxy using the Consul VIP DNS name (e.g., See hashicorp/consul#12116 (comment) for more info on this. |
Community Note
Overview of the Issue
Thanks for all the great work! We are trying to get the transparent proxy going with mesh traffic only, and to get it to route successfully via a terminating gateway. In the end we got it working but there are a few things that are undocumented or maybe even bugs, so I am noting them here for documentation updates.
Reproduction Steps
Terminating gateway will not work with transparent proxy unless dns is enabled in the helm chart. This is because otherwise dns entries like .virtual.consul do not resolve (where is exposed on the terminating gateway), and this is needed for the envoy traffic filters to route properly. AFAICS this is specific to terminating gateway services since these services do not have corresponding k8s resources / cluster IPs.
If you add a pod annotation specifying the service downstreams, then no transparent proxy envoy filters are created for those services. This is particularly confusing if you have specified ALL the services this way, since in this case the outbound listener on 15001 isn't created at all! I expected the transparent proxy setup to make the annotations redundant, rather than having to remove the same-datacenter ones.
Environment details
The text was updated successfully, but these errors were encountered: