Skip to content

Adding Alpn for TCP metadata exchange support#20126

Merged
istio-testing merged 1 commit intoistio:masterfrom
gargnupur:nup_tcp_meta_alpn
Jan 22, 2020
Merged

Adding Alpn for TCP metadata exchange support#20126
istio-testing merged 1 commit intoistio:masterfrom
gargnupur:nup_tcp_meta_alpn

Conversation

@mandarjog
Copy link
Copy Markdown
Contributor

@mandarjog mandarjog commented Jan 13, 2020

This PR is by @gargnupur

Please specifically review DownstreamTlsContext we add istio-peer-exchange as the first one in order along with http and for UpstreamTlsContext, add istio-peer-exchange with istio for TCP.

Doc for ref: https://docs.google.com/document/d/1s6ou__qRL4UiWY1amyk5p8YzOMQvBhfR15o1U_ZLIow/edit#heading=h.7zgnj8bwqfld

@istio-testing istio-testing added the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label Jan 13, 2020
@googlebot googlebot added the cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. label Jan 13, 2020
@istio-testing istio-testing added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 13, 2020
@mandarjog mandarjog requested review from diemtvu and yxue January 13, 2020 17:59
Copy link
Copy Markdown
Member

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

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

cc @yxue

go.mod Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is this part of the WIP?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes.

@mandarjog
Copy link
Copy Markdown
Contributor Author

@yxue @diemtvu please review per @gargnupur s email. Thanks.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why changing the TLS context for gateway?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for pointing.. removing

@yxue yxue self-assigned this Jan 13, 2020
@rshriram
Copy link
Copy Markdown
Member

Pay attention to upgrades please.

What happens if a 1.4 proxy gets this config and tries to talk to another 1.4 proxy that hasn't gotten this config?
What happens if a 1.5 proxy tries to talk to a 1.4 proxy that got this config (with the new alpn) ?

@yxue
Copy link
Copy Markdown
Member

yxue commented Jan 13, 2020

My initial thoughts is that we should only use this ALPN for proxy 1.5. If one of the client or server is using proxies with other versions, the metadata exchange filters will keep silent since one of them doesn't provide ALPN "istio-peer-exchange".

@gargnupur
Copy link
Copy Markdown
Contributor

@rshriram : @yxue pointed it right, in terms of upgrades if one of the proxy is a different version, ALPN "istio-peer-exchange" will not get negotiated and metadata exchange filter will not do anything as it won't find "istio-peer-exchange" as the negotiated alpn.

@mandarjog mandarjog requested review from a team January 14, 2020 01:45
@istio-testing istio-testing added the needs-rebase Indicates a PR needs to be rebased before being merged label Jan 14, 2020
@mandarjog
Copy link
Copy Markdown
Contributor Author

@rshriram Should we put this behind a feature flag, in this case on by default?

@mandarjog
Copy link
Copy Markdown
Contributor Author

@gargnupur we also need integration/e2e tests with this pr.

@yxue
Copy link
Copy Markdown
Member

yxue commented Jan 14, 2020

@rshriram : @yxue pointed it right, in terms of upgrades if one of the proxy is a different version, ALPN "istio-peer-exchange" will not get negotiated and metadata exchange filter will not do anything as it won't find "istio-peer-exchange" as the negotiated alpn.

I think we should put the code behind the feature flag as @mandarjog pointed out which is controlled by both the proxy version and some feature flag to prevent the scenario that Pilot sends the configuration with metadata exchange filter to 1.4 proxy.

Examples:

func IsProtocolSniffingEnabledForOutbound(node *model.Proxy) bool {

@istio-testing istio-testing added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed needs-rebase Indicates a PR needs to be rebased before being merged size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 14, 2020
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

istio_requests_total is a http metric. I think a TCP metric is supposed to be tested here?

Copy link
Copy Markdown
Contributor

@gargnupur gargnupur Jan 17, 2020

Choose a reason for hiding this comment

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

istio_requests_total is for both http and tcp now. It has protocol field that differentiates between the two.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why aren't we following what we have right now? https://istio.io/docs/reference/config/policy-and-telemetry/metrics/ Our dashboard built on the assumption about the categorization of the metrics. And I think there would be user's customized dashboard based on this assumption too. I looked into proxy's code and looks like we are actually not reporting those four tcp metrics?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We added TCP as protocol in existing metrics.. I can make a change to proxy first and then here to match what we had for 1.4..

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks.. Added a TODO for the same.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you lower case the package name as well as 'TCP' in path?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks..done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why not verify source side telemetry?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Because we don't get client complete destination info in client side telemetry yet because of envoyproxy/envoy-wasm#291. Will add once this bug is fixed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please add a todo here as well to install these filters via istioctl.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Unrelated change? If you want to disable mixer, you should set up operator values:

cfg.Values["telemetry.enabled"] = "true"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Done..

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove this? I don't think you need to instantiate a mixer instance.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks..Fixed

@gargnupur
Copy link
Copy Markdown
Contributor

/test gencheck_istio
/test unit-tests_istio
/test integ-istioio-k8s-tests_istio

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

there seems quite some duplicate in this if/else, at least for comments.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fixed

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this flag is default off and the effect only are showed in this particular test, right? might worth to try a default on (WIP pr, no need for merge) to see if other features like permissive or sniffing still works from CI tests running results

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Have a PR for turning this default on.. #20258 (will work to fix the conflicts from it)

Regarding permissive or sniffing related tests, they should get ALPN on by default because that is dependent on value of PILOT_ENABLE_TCP_METADATA_EXCHANGE which is default on. This test, tests the mixer v2 part of it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could this be a problem if the clients of this server has not upgraded?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It should not be because, then ALPN won't match and metadata exchange won't get enabled.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So it's true by default in 1.5? Could it cause troubles for upgrade path? (some servers have switched to the new ALPN but others might haven't)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It should not be because, then ALPN won't match and metadata exchange won't get enabled.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I mean if the server side was enabled, but some clients haven't, then does traffic will get into the (catch-all) filter chain? It my understanding, just want to confirm.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So this is for TCP only.. so it should get into TCP specific filter chain only...
@yxue : that sound right, right?

@istio-testing istio-testing added the needs-rebase Indicates a PR needs to be rebased before being merged label Jan 21, 2020
… when using mTLS

Update based on config

Fix tests

Trying to fix  tests

Just do for TCP

Enable Metadata Exchange for TCP when mTLS is on

cleanup

cleanup

Fixing lint  errors and running make gen

Fix make gen

Running make gen after rebase

Fix license file

Add option to enable metadata exchange
Fix licensing file

Add e2e test

Fix e2e test

Fix e2e test

Fix tests

Fix cleanup

Fix based on feedback

Add meta exc config to filter_types.go

Run make gen

Using INSERT_BEFORE to adding metadata exchange filter in the top of the list

Fix spacing nit

Fixed based on feedback

Fixed based on feedback

Fixed based on feedback

Fixed dup in comments
@istio-testing istio-testing removed the needs-rebase Indicates a PR needs to be rebased before being merged label Jan 21, 2020
@fejta
Copy link
Copy Markdown

fejta commented Jan 21, 2020

Can you rebase this PR please? (and then /hold cancel)
/hold

@fejta
Copy link
Copy Markdown

fejta commented Jan 21, 2020

/hold cancel

NM, already happened

@gargnupur gargnupur requested a review from richardwxn January 22, 2020 00:08

replace github.com/Azure/go-autorest => github.com/Azure/go-autorest v13.2.0+incompatible

replace github.com/istio.io/proxy/src/envoy/tcp/metadata_exchange/config v0.0.0 => ./pilot/pkg/metadata_exchange
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why we are doing this? Either import from pilot directly or import from istio.io/proxy?

If this is actually intended, and not just a WIP like previously indicated, can we at least comment why since its not intuitive at all

@istio-testing istio-testing merged commit 92ed864 into istio:master Jan 22, 2020
howardjohn pushed a commit to howardjohn/istio that referenced this pull request Jan 24, 2020
Turn on v2 telemetry on by default for http and tcp

THIS IS PENDING TOC APPROVAL

For TCP this will use Alpn based prefixed tunelling metadata exchange -> pending istio#20126

Followed @howardjohn's PR istio#20225 for this.

Fixed based on feedback

Fix bad rebase

Trying to fix bas rebase again

Trying to fix bas rebase again

Trying to fix bas rebase again
gargnupur added a commit to gargnupur/istio that referenced this pull request Jan 27, 2020
Turn on v2 telemetry on by default for http and tcp

THIS IS PENDING TOC APPROVAL

For TCP this will use Alpn based prefixed tunelling metadata exchange -> pending istio#20126

Followed @howardjohn's PR istio#20225 for this.

Fixed based on feedback

Fix bad rebase

Trying to fix bas rebase again

Trying to fix bas rebase again

Trying to fix bas rebase again

fix assets file

Running Make Gen

Running Make Gen after changes to values.yaml

Set telemetry component to false

Add EnvoyFilter for TCP

Run Make gen again
Enable mixer in mixer tests

Fix Unit test
istio-testing pushed a commit that referenced this pull request Jan 27, 2020
* add option

Turn on v2 telemetry on by default for http and tcp

THIS IS PENDING TOC APPROVAL

For TCP this will use Alpn based prefixed tunelling metadata exchange -> pending #20126

Followed @howardjohn's PR #20225 for this.

Fixed based on feedback

Fix bad rebase

Trying to fix bas rebase again

Trying to fix bas rebase again

Trying to fix bas rebase again

fix assets file

Running Make Gen

Running Make Gen after changes to values.yaml

Set telemetry component to false

Add EnvoyFilter for TCP

Run Make gen again
Enable mixer in mixer tests

Fix Unit test

* Run make gen
howardjohn pushed a commit to howardjohn/istio that referenced this pull request Jan 27, 2020
* add option

Turn on v2 telemetry on by default for http and tcp

THIS IS PENDING TOC APPROVAL

For TCP this will use Alpn based prefixed tunelling metadata exchange -> pending istio#20126

Followed @howardjohn's PR istio#20225 for this.

Fixed based on feedback

Fix bad rebase

Trying to fix bas rebase again

Trying to fix bas rebase again

Trying to fix bas rebase again

fix assets file

Running Make Gen

Running Make Gen after changes to values.yaml

Set telemetry component to false

Add EnvoyFilter for TCP

Run Make gen again
Enable mixer in mixer tests

Fix Unit test

* Run make gen

(cherry picked from commit a24f595)
istio-testing pushed a commit that referenced this pull request Jan 27, 2020
* add option

Turn on v2 telemetry on by default for http and tcp

THIS IS PENDING TOC APPROVAL

For TCP this will use Alpn based prefixed tunelling metadata exchange -> pending #20126

Followed @howardjohn's PR #20225 for this.

Fixed based on feedback

Fix bad rebase

Trying to fix bas rebase again

Trying to fix bas rebase again

Trying to fix bas rebase again

fix assets file

Running Make Gen

Running Make Gen after changes to values.yaml

Set telemetry component to false

Add EnvoyFilter for TCP

Run Make gen again
Enable mixer in mixer tests

Fix Unit test

* Run make gen

(cherry picked from commit a24f595)

Co-authored-by: Nupur Garg <37600866+gargnupur@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.