Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Support transparent proxy in the Consul Helm chart #905

Merged
merged 5 commits into from
Apr 14, 2021

Conversation

ishustava
Copy link
Contributor

@ishustava ishustava commented Apr 9, 2021

Changes proposed in this PR:

  • Add new connectInject.transparentProxy.defaultEnabled value (default to true)
    that will allow users to enable or disable tproxy for each helm installation.
  • Add acceptance tests for connect-inject to test with tproxy
  • Acceptance tests default to tproxy not enabled since we don't fully support it for all features yet.

How I've tested this PR:

  • Enabled tproxy for connect oss and enterprise tests

How I expect reviewers to test this PR:

  • code review

Note that for beta we're only enabling connect tests to run with tproxy. Before GA, ideally, we can default to tproxy all the time and test non-tproxy cases explicitly instead.

Checklist:

  • Bats tests added
  • CHANGELOG entry added (HashiCorp engineers only, community PRs should not add a changelog entry)

* Add new connectInject.transparentProxy.defaultEnabled value (default to true)
  that will allow users to enable or disable tproxy for each helm installation.
* Add acceptance tests for connect-inject to test with tproxy
@ishustava ishustava changed the title Enable TProxy Support transparent proxy in the Consul Helm chart Apr 14, 2021
@ishustava ishustava requested review from a team, ndhanushkodi and thisisnotashwin and removed request for a team April 14, 2021 00:10
Copy link

@thisisnotashwin thisisnotashwin left a comment

Choose a reason for hiding this comment

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

This looks great. Looking at the failures in the acceptance, I think those fixtures need to be updated in order to ensure they start to use the t-proxy clients/addresses to the remote server.

Great job with this test though. It was super easy to understand!

Copy link
Contributor

@ndhanushkodi ndhanushkodi left a comment

Choose a reason for hiding this comment

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

LGTM!! Just had a few non-blocking questions.

@@ -90,6 +90,9 @@ spec:
-release-name="{{ .Release.Name }}" \
-release-namespace="{{ .Release.Namespace }}" \
-listen=:8080 \
{{- if .Values.connectInject.transparentProxy.defaultEnabled }}
-enable-transparent-proxy \
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm just noticing this now and it's not a blocker for the release, but should this flag be renamed -default-enable-transparent-proxy in consul-k8s after the release? That's how the metrics flag defaults are named.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good catch! I'll a task to rename.

[]string{
"curl: (52) Empty reply from server",
"curl: (7) Failed to connect to static-server port 80: Connection refused",
"curl: (7) Failed to connect to static-server.ns1 port 80: Connection refused",
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious, did you see these additional errors when testing out tproxy?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, when with iptables we now get a connection refused. This is most likely because envoy itself will now reject the connection, whereas previously this error was coming from the upstream proxy that verifies intentions.

Copy link

@thisisnotashwin thisisnotashwin left a comment

Choose a reason for hiding this comment

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

exquisite!!

@ishustava ishustava merged commit b342ef0 into feature-tproxy Apr 14, 2021
@ishustava ishustava deleted the enable-tproxy branch April 14, 2021 18:37
thisisnotashwin pushed a commit that referenced this pull request Apr 15, 2021
Support transparent proxy in the consul helm chart
* Add new connectInject.transparentProxy.defaultEnabled value (default to true)
  that will allow users to enable or disable tproxy for each helm installation.
* Add acceptance tests for connect-inject to test with tproxy
* Acceptance tests default to tproxy not enabled since we don't fully support it for all features yet.
ishustava added a commit that referenced this pull request Apr 16, 2021
Support transparent proxy in the consul helm chart
* Add new connectInject.transparentProxy.defaultEnabled value (default to true)
  that will allow users to enable or disable tproxy for each helm installation.
* Add acceptance tests for connect-inject to test with tproxy
* Acceptance tests default to tproxy not enabled since we don't fully support it for all features yet.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants