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

examples: Add double proxy sandbox #13748

Merged
merged 30 commits into from
Nov 10, 2020

Conversation

phlax
Copy link
Member

@phlax phlax commented Oct 25, 2020

Signed-off-by: Ryan Northey ryan@synca.io

Commit Message: examples: Add double proxy sandbox
Additional Description:

this provides a sandbox with the following setup:

envoy (front) -> flask-app -> envoy (postgres-front) -> envoy(postgres-back) -> postgres

essentially it demonstrates using Envoy in a situation where a frontend app is not on the same subnet as its db, and uses a proxy in each of the subnets to transport traffic between.

ideally, the traffic between envoy (postgres-front) -> envoy (postgres-back) should be encrypted (and perhaps authenticated) to show a situation of the traffic travelling over insecure/public networks

Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Deprecated:]

Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
@phlax phlax marked this pull request as draft October 25, 2020 09:58
@phlax
Copy link
Member Author

phlax commented Oct 25, 2020

@mattklein123 not sure how useful this is or if this is what is meant in docs etc by "double proxy"

its the pattern i was most interested in when i first looked at envoy - kinda like subnet (rather than pod/container) sidecars, that can be used as a bridge/router to upstream services

not sure if encrypting traffic in the middle proxies is possible, but it would make for a much better sandbox if it is, and would remove the need to use vpns etc in this kind of set up, esp if we could do client authentication

Signed-off-by: Ryan Northey <ryan@synca.io>
@mattklein123 mattklein123 self-assigned this Oct 27, 2020
@mattklein123
Copy link
Member

what is meant in docs etc by "double proxy"

Yeah this is an example of a double proxy scenario. The most common example is in POPs, something like envoy <pop> <-> envoy <origin> <-> backend

We can definitely encrypt across the hops. This is typically done using mTLS but it depends on the scenario. I think we could do this with a self-signed cert and make for a pretty interesting sandbox.

Let me know how you want to proceed on this one.

/wait

Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
.azure-pipelines/pipelines.yml Outdated Show resolved Hide resolved
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
@phlax
Copy link
Member Author

phlax commented Oct 30, 2020

ive added mtls and all appears to work - just ironing out wrinkles with the example

i still need to add some docs

one question im now wondering is whether we could/should add compression to the mtls filling

Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
@phlax
Copy link
Member Author

phlax commented Oct 31, 2020

afaict compression wont work as its http/hcm based and in this example the middle proxies arent using http

Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
@phlax phlax changed the title [WIP] examples: Add double proxy sandbox examples: Add double proxy sandbox Oct 31, 2020
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks also super awesome. @ggreenway or @PiotrSikora would one of you be willing to do a quick review of the TLS setup here? Thank you!

/wait

docs/root/start/sandboxes/double-proxy.rst Show resolved Hide resolved
examples/double-proxy/envoy-backend.yaml Outdated Show resolved Hide resolved
Signed-off-by: Ryan Northey <ryan@synca.io>
@phlax
Copy link
Member Author

phlax commented Nov 6, 2020

@mattklein123 if we can land the securing quick-start page first, ill update this and tie them together

Signed-off-by: Ryan Northey <ryan@synca.io>
@mattklein123
Copy link
Member

Yeah I think dropping SNI from this one makes sense.

/wait

@phlax
Copy link
Member Author

phlax commented Nov 10, 2020

great, updating...

Signed-off-by: Ryan Northey <ryan@synca.io>
@phlax
Copy link
Member Author

phlax commented Nov 10, 2020

Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@mattklein123 mattklein123 merged commit 8e6b176 into envoyproxy:master Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants