-
Notifications
You must be signed in to change notification settings - Fork 9
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
service-mesh: blackhole traffic destined for the TPROXY port #1171
base: main
Are you sure you want to change the base?
service-mesh: blackhole traffic destined for the TPROXY port #1171
Conversation
3u13r
commented
Jan 21, 2025
•
edited
Loading
edited
- blackhole traffic that would cause the envoy to infinitely connect to itself
- add tests for the envoy config
ac085b5
to
47b9850
Compare
47b9850
to
b62d878
Compare
Traffic to the TPROXY port (15006/15007) led to a traffic storm as envoy used the original destination to forward the traffic to, therefore forwarding it again to the TPROXY port where envoy listens. This commit introduces a Blackhole cluster where we send traffic to, that arrives on the TPROXY listeners and which original destination port is the TPROXY.
b62d878
to
85a7740
Compare
With increasing envoy config complexity it gets more difficult to parse the final envoy config. Therefore we introduce tests which compare the envoy config for specific scenarios with golden JSON representations of the expected output.
85a7740
to
5a6afdd
Compare
continue | ||
} | ||
if len(listener.FilterChains) != 1 { | ||
return fmt.Errorf("listener %s doesn't has exactly one existing listener", listener.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return fmt.Errorf("listener %s doesn't has exactly one existing listener", listener.Name) | |
return fmt.Errorf("listener %s doesn't have exactly one existing listener", listener.Name) |
if listenPort == 0 { | ||
return fmt.Errorf("listener %s listens on port 0", listener.Name) | ||
} | ||
if listenPort != 15006 && listenPort != 15007 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make these arguments and use constants where we're calling addBlackHoleToConfig
? That'd allow easier customization later on - I've been wondering lately when we'll have the first user that wants these ports for their app :)
// Blackhole traffic that arrives on the original destination listerners, | ||
// which original port is the envoy itself, i.e. traffic that was not redirected | ||
// to the envoy via the TROXY iptables rule. Such traffic would lead to a | ||
// traffic storm since envoy would connect to the original destination | ||
// i.e. itself again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a sentence that explains how the traffic is blackholed - is it because there is no upstream in the cluster?
func TestMain(m *testing.M) { | ||
goleak.VerifyTestMain(m) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you introduce this for a specific reason? This binary looks pretty serial...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I thought we would just add this per convention for new tests, since e.g.,
contrast/internal/fsstore/fsstore_test.go
Line 17 in 5a6afdd
func TestMain(m *testing.M) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't, was just curious.