Skip to content

EDS tests and refactoring#3949

Merged
costinm merged 20 commits intomasterfrom
costin-eds
Mar 6, 2018
Merged

EDS tests and refactoring#3949
costinm merged 20 commits intomasterfrom
costin-eds

Conversation

@costinm
Copy link
Copy Markdown
Contributor

@costinm costinm commented Mar 5, 2018

  • added a unit/integration local test checking the grpc streaming directly
  • refactored the testing code to allow better starting pilot and envoy for the local tests
  • refactored the grpc server initialization, now part of pilot/pkg/bootstrap
  • moved edsv2 code in the v2 directory.
  • fixed the streaming of endpoints

This PR uses EDSv2 by default, depending on testing results we may chose a different
value.

@costinm costinm requested a review from ldemailly as a code owner March 5, 2018 17:57
@costinm costinm requested review from a team March 5, 2018 17:57
@istio-merge-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
We suggest the following additional approver: kyessenov

Assign the PR to them by writing /assign @kyessenov in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@costinm
Copy link
Copy Markdown
Contributor Author

costinm commented Mar 5, 2018

Note that while testing this I found that EDSv1 was not working well with the envoy in front of pilot - by default the TCP cluster has max 1024 connections, and the sidecars make one TCP connection per cluster, resulting in cases where EDS1 was failing ( I test on a cluster with ~500 services, to make sure we don't break the memory fixes ).

So temporarily I've moved back the 'insecure' pilot to 8080 - and will try to have better settings for the
grpc port, which doesn't yet have certificates.

Makefile Outdated

istio.yaml:
helm template --set global.tag=${TAG} \
--namespace=istio-system \
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.

mis-alignment with 1 blank space.

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.

done

"time"

"google.golang.org/grpc"

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.

imports follow one style, run/fmt.sh

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.

Well - run/fmt.sh seems to be broken, doesn't match linter...


// AdmissionArgs provides configuration options for the admission controller. This is a partial duplicate of
// admit.ControllerOptions (other fields are filled out before constructing the admission controller). Only
// admito.ControllerOptions (other fields are filled out before constructing the admission controller). Only
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.

typo admit.

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.

Done

type Server struct {
mesh *meshconfig.MeshConfig
serviceController *aggregate.Controller
ServiceController *aggregate.Controller
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.

Justify for making these public.

doc comments are needed for every public variables.

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.

Are used from other packages - for some reasons all exposed fields in this class don't have
doc comments. Since it's not an API we would expose outside pilot, and most of this is
scheduled for deletion/deprecation - I don't think it's a huge priority.

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.

There are no exposed fields on the base version. I'm surprised we don't have a linter forcing some comments on public fields.
But if this is really soon to be deleted code... ok (though why do we need to add and expose new soon to be deleted code?)

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.

Having a struct exposing both private and public fields is an antipattern. Please add TODO to remove this code later.

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.

bootstrap/server.go is full of public fields - MeshArgs, ConsuleArgs, etc.
We are planning to replace the v1 registries with new data structures and event-based code, and almost all the http-based envoy discovery will also go away once v2 is done ( target is 0.8)

GRPCListeningAddr net.Addr
clusterStore *clusterregistry.ClusterStore

EnvoyXdsServer *envoyv2.DiscoveryServer
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.

package private variable should declare in lowercase: such as grpcServer.

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.

It's intended to be public, used in the other packages.

@rshriram
Copy link
Copy Markdown
Member

rshriram commented Mar 5, 2018

Can you file a bug for the Envoy in front of pilot thing ? Assign to Krishna since he implemented the istio on istio. IMO we should do tls directly from pilot instead of adding yet another Envoy.

@costinm
Copy link
Copy Markdown
Contributor Author

costinm commented Mar 6, 2018

Yes, I generally agree on doing mtls in pilot in future. There are many problems around this...

For envoy fixes - I'll probably do this work in a separate PR for the grpc port and switching to v2 bootstrap.

@costinm
Copy link
Copy Markdown
Contributor Author

costinm commented Mar 6, 2018

PTAL - tests are passing ! There are few more improvements to make before deciding if we leave it
enabled by default, one of the main reasons to move ahead is that it reduces the load on pilot, this
has been a big problem with v1.

type Server struct {
mesh *meshconfig.MeshConfig
serviceController *aggregate.Controller
ServiceController *aggregate.Controller
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.

There are no exposed fields on the base version. I'm surprised we don't have a linter forcing some comments on public fields.
But if this is really soon to be deleted code... ok (though why do we need to add and expose new soon to be deleted code?)

addr := s.HTTPServer.Addr
listener, err := net.Listen("tcp", addr)
if err != nil {
return err
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.

I couldn't find in the call chain where those errors get logged.
It would probably help troubleshooting to log something near/where the error occured?

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.

Code moved from discovery without changes :-)

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.

(DiscoveryService.Start)

Agree with the comment - but additional improvements can be made in separate PRs, not trying to fix all the problems in one.

@costinm costinm requested a review from a team March 6, 2018 17:56
@istio-testing
Copy link
Copy Markdown
Collaborator

@costinm: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
prow/e2e-simpleTests.sh 419f530 link /test e2e-simple
prow/e2e-bookInfoTests.sh 419f530 link /test e2e-bookInfo
prow/istio-pilot-e2e.sh 419f530 link /test istio-pilot-e2e
Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@costinm costinm merged commit 80e65b5 into master Mar 6, 2018
@sebastienvas
Copy link
Copy Markdown
Contributor

this basically prevent the code package check. There is a codecov.skip where you can put the thing that are do not want to be covered instead of disabling the check for all packages.

@costinm costinm deleted the costin-eds branch March 7, 2018 23:48
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.

9 participants