Backport of Disable DNS redirection when tproxy is disabled into release/1.1.x #2178
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport
This PR is auto-generated from #2176 to be assessed for backporting due to the inclusion of the label backport/1.1.x.
The below text is copied from the body of the original PR.
Changes proposed in this PR:
DNS redirection and the various settings that make that possible (like
the dataplane binding to a port for DNS) is only useful if tproxy is
enabled. Most of the code checked if tproxy was enabled but there
was one location where we didn't check. This resulted in a bug
with our multiport support where even though tproxy is disabled,
we tried to setup the dataplane to proxy DNS. This meant each dataplane
tried to bind to 8600 but because there are >1 dataplanes with
multiport, there was a port conflict.
This PR fixes the location where we didn't check if tproxy was enabled
and as a result fixes the multiport issue.
the reason this wasn't caught in our acceptance tests is because we don't run the multiport test when global tproxy is enabled and this bug only occurs when global tproxy is enabled but pod-level tproxy is disabled
Fixes consul-dataplane fails to bind to port 8600 in multiport connect-inject service mesh using local kind cluster #2144
How I've tested this PR:
go test ./... -p 1 -timeout 20m -run TestConnectInject_MultiportServices -no-cleanup-on-failure -v -consul-image hashicorppreview/consul:1.16-dev -enable-transparent-proxy -consul-k8s-image ghcr.io/lkysow/consul-k8s-dev:mar25-23@sha256:fba790b616687308a2b1159da087eb52109d8acda239b1b69a1775bf12db9570
How I expect reviewers to test this PR:
Checklist:
Overview of commits