Skip to content
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

Envoy sidecar filter config incorrectly generated #17475

Open
mr-miles opened this issue May 25, 2023 · 3 comments
Open

Envoy sidecar filter config incorrectly generated #17475

mr-miles opened this issue May 25, 2023 · 3 comments
Labels
theme/connect Anything related to Consul Connect, Service Mesh, Side Car Proxies theme/terminating-gw Track terminating gateway work

Comments

@mr-miles
Copy link
Contributor

mr-miles commented May 25, 2023

Overview of the Issue

I have a service within the mesh running with a transparent proxy, and a database outside the service mesh, and I want to connect them through the terminating-gateway. However the envoy sidecar configuration is being generated as if it were an http service, whereas I have set the service up to use tcp by default.


Reproduction Steps

  1. Set up consul service mesh in transparent proxy mode with a terminating gateway
  2. Register a dummy service named "my-service" with the consul catalog
  3. Register these configuration objects:
proxy-defaults:
 - protocol: http

service-defaults:
 - name: database
 - protocol: tcp

terminating-gateway:
 - name: tgw
 - services:
   - name: database

service-intention:
 - destination: my-service
 - sources:
   - name: database
  1. Start the sidecar for my-service so it retrieves configuration from consul
  2. Observe that the configuration contains an http-connection-manager that attempts to route traffic based on the request path and name like so:

image

  1. Observe from the http api that the discovery-chain for database claims that traffic is tcp and not http

I found that the problem could be fixed by overriding the upstream protocol for my-service:

service-defaults:
 - name: my-service
 - protocol: http
 - upstreamConfig:
   overrides:
     - name: database
       protocol: tcp

Yielding:
image

I believe that the upstream config is incorrectly coming from the proxy-defaults and not the defaults for the target service.

I also tried with and without specifying a Destination entry on the service-defaults for database, but that did not affect the presence of the http-connection-manager

-->

Consul info for both Client and Server

Helm chart: 1.1.1, overridden to use the server 1.15.2 image
Environment: AWS EKS

@jkirschner-hashicorp jkirschner-hashicorp added theme/connect Anything related to Consul Connect, Service Mesh, Side Car Proxies theme/terminating-gw Track terminating gateway work labels May 25, 2023
@mr-miles
Copy link
Contributor Author

mr-miles commented Jul 5, 2023

fixed in #17894 - can't wait for the patch release

@david-yu
Copy link
Contributor

david-yu commented Jul 5, 2023

Hi @mr-miles did you verify that the PR fixed the issue mentioned here? The PR btw was backported to 1.16.x, 1.15.x and 1.14.x and will be released approximately 5 weeks from now.

@mr-miles
Copy link
Contributor Author

mr-miles commented Jul 5, 2023

Actually no (blush) i haven't verified it - if i can find an image of the nightly 1.16.x build then i can give it a go.

But I had read through the code and worked out that this was the root cause a day or two before that PR landed - in fact I had started a near-identical PR of my own - so I feel pretty solid on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/connect Anything related to Consul Connect, Service Mesh, Side Car Proxies theme/terminating-gw Track terminating gateway work
Projects
None yet
Development

No branches or pull requests

3 participants