Skip to content

Sidecar config resource#742

Merged
istio-testing merged 17 commits intoistio:release-1.1from
rshriram:sidecars
Jan 7, 2019
Merged

Sidecar config resource#742
istio-testing merged 17 commits intoistio:release-1.1from
rshriram:sidecars

Conversation

@rshriram
Copy link
Copy Markdown
Member

Based on discussions and past networking meetings around
https://docs.google.com/document/d/1jmH8N0OdyJb1W6hB6xdLZXzdGUKs6GknI5Ayb6wD430

Renamed and revamped ServiceDependency and made some gateway edits as well.

Signed-off-by: Shriram Rajagopalan shriramr@vmware.com

Shriram Rajagopalan added 3 commits December 14, 2018 14:44
Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com>
Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com>
Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com>
@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 Dec 27, 2018
Copy link
Copy Markdown
Contributor

@costinm costinm left a comment

Choose a reason for hiding this comment

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

Few inline comments - can be handled in separate PRs ( I assume we'll iterate few times, and not all will be implemented in 1.1 - what we can't implement well enough will need to be hidden or documented ).

The bind to port is the trickiest, in particular since 'bind=false' option in envoy is deprecated and a sidecar config may apply to workloads with different modes.

Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com>
@costinm
Copy link
Copy Markdown
Contributor

costinm commented Dec 28, 2018 via email

@costinm
Copy link
Copy Markdown
Contributor

costinm commented Dec 28, 2018 via email

@costinm
Copy link
Copy Markdown
Contributor

costinm commented Dec 28, 2018 via email

@costinm
Copy link
Copy Markdown
Contributor

costinm commented Dec 28, 2018 via email

Copy link
Copy Markdown
Member Author

@rshriram rshriram left a comment

Choose a reason for hiding this comment

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

.

@rshriram
Copy link
Copy Markdown
Member Author

workloadSelector in the doc is in first example

 selector:
    labels:
      app: bookstore

in terms of the workloadSelector, right now we only have labels, but I have created room for this to grow once we have the ability to identify the workload by other information (from certs/etc.).

Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com>
@rshriram rshriram requested review from louiscryan and removed request for andraxylia and diemtvu December 29, 2018 04:42
@rshriram
Copy link
Copy Markdown
Member Author

cc @louiscryan

@costinm
Copy link
Copy Markdown
Contributor

costinm commented Dec 29, 2018 via email

@costinm
Copy link
Copy Markdown
Contributor

costinm commented Dec 29, 2018 via email

@hzxuzhonghu
Copy link
Copy Markdown
Member

Looks very good after this round.

We can't just rename fields and change structure without very strong
reasons, the API is supposed to be stable
and backward compatible

Agree, unless one day selector can not satisfy users.

@rshriram
Copy link
Copy Markdown
Member Author

We can't identify from certs except at connect time, it is not known from
discovery - and even there the cert is just used to verify the info passed
in labels and the namespace. IP is clearly a dead end.

What do you mean? The sidecar resource to use will be selected after the proxy connects (we search through the list of sidecar resources on the namespace that matches the proxy's labels and apply it - this is how we do it for the gateway). So, instead of searching through the proxy labels (which requires GetProxyServiceInstances call for the updated set of labels), we can search through the proxy's cert info such as subject names/domains/other metadata that people traditionally embed on the workload's cert. Something like this:

workloadSelector:
  x509:
       Organization: sales
       OrganizationalUnit: department1

and we can try to match this with the info in the x509 cert when trying to pick the right sidecar for the resource. The x509 infrastructure is common among large vm installations and several folks such as eBay use the x509 fields such as the above for their access control, etc. Treat these fields as the equivalent of a namespace or some such division. Come to think of it, the entire CF infrastructure has x509 certs for every CF app instance (pod equivalent) and they dont have the concept of labels.

Note that this is not added in the API yet.

@rshriram
Copy link
Copy Markdown
Member Author

Also, deprecating the selector is the only way to transition people using Gateways to have per namespace label selector instead of "all namespace" mode that we currently have. Otherwise, it will be a big breaking change - take a look at all the example gateway configs in the mailing list. Most of them will break if we simply change the gateway selector to be namespace only.

@ZackButcher
Copy link
Copy Markdown
Contributor

+1 on selectors other than labels - cert fields (or SPIFFE identities) are a clear use case for non-label selection. CIDR ranges are also a valuable selector (and supporting a single IP address falls out of supporting CIDR ranges).

Shriram Rajagopalan added 2 commits January 2, 2019 19:59
Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com>
Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com>
@costinm
Copy link
Copy Markdown
Contributor

costinm commented Jan 3, 2019 via email

@rshriram
Copy link
Copy Markdown
Member Author

rshriram commented Jan 3, 2019

https://docs.google.com/document/d/15p1PcYIUE18q5dbWJoYY5teyNgnnjBg73597-Tw6dzY is the doc restating what I noted earlier on the extensibility

// on which this gateway configuration should be applied. The scope of
// label search is restricted to the configuration namespace in which the
// the resource is present. In other words, the Gateway resource must
// reside in the same namespace as the gateway workload.
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.

What about backward compatibility with label istio: ingressgateway? Should that be a special case, or maybe istio-system namespace is a special namespace whose workloads are virtually present in every other namespace?

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'll need a 'migration' section - explaining that the behavior in 1.0 had a bug, and how to move away.
But it can be in the release notes or separate doc - the text in this PR is correct.

// One or more services/virtualServices exposed by the listener in
// namespace/dnsName format. _*Hosts will be ignored for ingress
// servers*_. For egress servers, the hosts field results in importing
// one or more publicly scoped services and VirtualServices from remote
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.

How can a service be privately scoped? What happens if a service is private but the corresponding virtualservice is public?

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.

Then the VirtualService would have to be defined in the same namespace as the private service

Copy link
Copy Markdown
Contributor

@costinm costinm left a comment

Choose a reason for hiding this comment

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

Still looking good but not perfect - we can address comments and improve it in separate PRs before the release. I suspect while implementing testing we'll find more improvements.

/lgtm

// point on the sidecar to a port or unix domain socket where the
// application workload is listening for connections. Format should be
// 127.0.0.1:PORT or unix:///path/to/socket
string default_endpoint = 5;
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.

Should we use the same format for the 'bind' ?

Do we allow default_endpoint to be a non-local IP or a DNS entry ? If not, would be good to be explicit ( and why ).
If we do - an example.

// sidecar configuration should be applied. If omitted, the sidecar
// configuration will be applied to all workloads in the current config
// namespace.
WorkloadSelector workload_selector = 1;
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.

Let's introduce workload_selector consistently, for all configs - it's confusing to have Sidecar use one style
and the rest use a different one, and the discussion on how to use non-label selection is still not resolved.

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 see it is hidden - so maybe it's ok to leave it there if in 1.1 we just implement the default Sidecar.

@istio-testing
Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: costinm, rshriram

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

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Shriram Rajagopalan added 2 commits January 7, 2019 16:07
Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com>
Signed-off-by: Shriram Rajagopalan <shriramr@vmware.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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants