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

Upstream TCP with proxy protocol #44342

Open
JuniorJPDJ opened this issue Apr 11, 2023 · 12 comments
Open

Upstream TCP with proxy protocol #44342

JuniorJPDJ opened this issue Apr 11, 2023 · 12 comments
Labels
area/networking kind/docs kind/enhancement lifecycle/automatically-closed Indicates a PR or issue that has been closed automatically.

Comments

@JuniorJPDJ
Copy link

JuniorJPDJ commented Apr 11, 2023

Describe the feature request
Making connection to upstreams services (envoy clusters) encapsulated in PROXY protocol.
Feature was requested at forums at least 2 times and I saw some stackoverflow posts about it too:

Describe alternatives you've considered
EnvoyFilter, but now it's impossible to do using filters due to transport_socket_matches being an array - MERGE is adding transport_socket at the end and it's never matched as

      {
        "name": "tlsMode-disabled",
        "match": {},
        "transport_socket": {
         "name": "envoy.transport_sockets.raw_buffer",
         "typed_config": {
          "@type": "type.googleapis.com/envoy.extensions.transport_sockets.raw_buffer.v3.RawBuffer"
         }
        }
       }

is before and is matching all the traffic.
The only way I figured out it very much dirty and is recreating whole cluster. This AFAIK makes it impossible to apply other EnvoyFilter.ClusterMatch filters based on service names later.

Affected product area (please put an X in all that apply)

[ ] Ambient
[x] Docs
[ ] Installation
[x] Networking
[ ] Performance and Scalability
[ ] Extensions and Telemetry
[ ] Security
[ ] Test and Release
[ ] User Experience
[ ] Developer Infrastructure

Affected features (please put an X in all that apply)

[ ] Multi Cluster
[ ] Virtual Machine
[ ] Multi Control Plane

@hzxuzhonghu
Copy link
Member

cc

@klarose
Copy link

klarose commented Apr 13, 2023

Thanks for posting this issue. It was previously tracked here as well: #42257

@JuniorJPDJ
Copy link
Author

JuniorJPDJ commented Apr 13, 2023

Thank you very much for your previous issue link!
I've not found it myself.
It looks like more people needs this feature too ;)

I see you had similar idea as mine but you found more info about internals handling this case.

Anyway - It's sad that istio doesn't support proxy protocol on downstream and on upstream, as IMO this could be just a flag on the route/listener.

There are real usecases for both and I see people asking for it in lots of issues (mostly downstream).

@JuniorJPDJ
Copy link
Author

My workaround from mentioned PR patch works!

@istio-policy-bot istio-policy-bot added the lifecycle/stale Indicates a PR or issue hasn't been manipulated by an Istio team member for a while label Oct 9, 2023
@istio-policy-bot istio-policy-bot added the lifecycle/automatically-closed Indicates a PR or issue that has been closed automatically. label Oct 24, 2023
@hzxuzhonghu
Copy link
Member

/reopen

@hzxuzhonghu hzxuzhonghu reopened this Nov 6, 2023
@istio-policy-bot istio-policy-bot removed the lifecycle/stale Indicates a PR or issue hasn't been manipulated by an Istio team member for a while label Nov 6, 2023
@rsalmond
Copy link

Can this be closed now that #48237 has shipped?

@JuniorJPDJ
Copy link
Author

Probably yes, I haven't checked if it works tho.

@JuniorJPDJ
Copy link
Author

There's no way to enable proxy protocol on only one of ports - it's only specified in TrafficPolicy and not in TrafficPolicy.PortTrafficPolicy.

@hzxuzhonghu
Copy link
Member

This is like tunnel, making it per port is viable too

@JuniorJPDJ
Copy link
Author

Also it looks like it's working only for cluster-internal services.
When trying to forward traffic to service with EndpointSlice targeted at IP beyond the cluster it doesn't send proxy headers.
It works for service with pod inside the cluster.

@JuniorJPDJ JuniorJPDJ reopened this Mar 15, 2024
@hzxuzhonghu
Copy link
Member

DR must be bound with a service, so you can define a SE for external service

@JuniorJPDJ
Copy link
Author

JuniorJPDJ commented Mar 15, 2024

It shouldn't be neccessary as I've native Service defined for those, just with ClusterIP: None and with EndpointSlice pointing to the IP.
With EnvoyFilter and my fork it worked good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/networking kind/docs kind/enhancement lifecycle/automatically-closed Indicates a PR or issue that has been closed automatically.
Projects
None yet
Development

No branches or pull requests

5 participants