Skip to content

Conversation

howardjohn
Copy link
Member

@howardjohn howardjohn commented Aug 3, 2023

Fixes #45241.

This PR swaps out ServiceInstances for ServiceTarget (an existing type
in XDS gen, now moved to model).

The intent here is to minimize the amount of information maintained.
Before, we had a Service+Endpoint+Port. Now we just have a Service+Port.

The Endpoint aspect was never used and was incorrect (see issue). Having
this extra information is dangerous, complex, and slow. By removing this
we can skip some wasteful processing, avoid accidentally using this
information that may or may not be accurate, etc. In the past, similar
"Struct is bigger than it needs to be" issues caused serious
regressions.

This change also can enable future optimizations.


The InstancesByPort usages:

ResolveGatewayInstances for status; known to be broken
Just whether there is instances on which ports
BestEffortInferServiceMTLSMode
Just need TLS mode
buildLocalityLbEndpoints:
Just endpoint (it mirrors EDS)
buildSidecarOutboundListeners:
for headless building. Just need endpoint address
BuildNameTable:
for headless. Its actually broken today a bit
We want each endpoint

@howardjohn howardjohn requested review from a team as code owners August 3, 2023 15:44
@howardjohn howardjohn added the release-notes-none Indicates a PR that does not require release notes. label Aug 3, 2023
@istio-testing istio-testing added needs-rebase Indicates a PR needs to be rebased before being merged size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 3, 2023
@howardjohn howardjohn force-pushed the pilot/stop-service-instances branch from 121ecee to 560bd47 Compare August 3, 2023 20:13
@istio-testing istio-testing removed the needs-rebase Indicates a PR needs to be rebased before being merged label Aug 3, 2023
@howardjohn howardjohn force-pushed the pilot/stop-service-instances branch from 560bd47 to a17bb34 Compare August 4, 2023 19:18
@istio-testing istio-testing added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 4, 2023
@howardjohn howardjohn force-pushed the pilot/stop-service-instances branch from a17bb34 to 39cc168 Compare August 4, 2023 19:27
@howardjohn howardjohn mentioned this pull request Aug 4, 2023
@howardjohn howardjohn force-pushed the pilot/stop-service-instances branch from 39cc168 to 4566d5e Compare August 7, 2023 20:15
@istio-testing istio-testing added the needs-rebase Indicates a PR needs to be rebased before being merged label Aug 7, 2023
@howardjohn howardjohn force-pushed the pilot/stop-service-instances branch from 4566d5e to 5d6a06f Compare August 7, 2023 20:23
@istio-testing istio-testing removed the needs-rebase Indicates a PR needs to be rebased before being merged label Aug 7, 2023
@howardjohn howardjohn force-pushed the pilot/stop-service-instances branch from 5d6a06f to a599858 Compare August 7, 2023 22:32
@istio-testing istio-testing added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 7, 2023
@howardjohn howardjohn force-pushed the pilot/stop-service-instances branch from a599858 to 505edd4 Compare August 8, 2023 16:53
Split out from https://github.com/istio/istio/pull/46295/files

This *is* user facing. If a user had a pod without Service before, we
would ignore locality. Now we do not. I *think* this is the last case of
"You must have a service" requirement, but need more investigation
before we fully drop that from
https://istio.io/latest/docs/ops/deployment/requirements/
@howardjohn howardjohn force-pushed the pilot/stop-service-instances branch from 505edd4 to 8242d43 Compare August 8, 2023 16:56
@istio-testing istio-testing removed the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Aug 8, 2023
@istio-testing istio-testing added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Aug 8, 2023
@@ -863,8 +863,8 @@ func (c *Controller) GetProxyServiceInstances(proxy *model.Proxy) []*model.Servi
return nil
}

func (c *Controller) serviceInstancesFromWorkloadInstance(si *model.WorkloadInstance) []*model.ServiceInstance {
out := make([]*model.ServiceInstance, 0)
func (c *Controller) serviceInstancesFromWorkloadInstance(si *model.WorkloadInstance) []model.ServiceTarget {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
func (c *Controller) serviceInstancesFromWorkloadInstance(si *model.WorkloadInstance) []model.ServiceTarget {
func (c *Controller) serviceTargetsFromWorkloadInstance(si *model.WorkloadInstance) []model.ServiceTarget {

Copy link
Contributor

@stevenctl stevenctl left a comment

Choose a reason for hiding this comment

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

LGTM!!

@howardjohn
Copy link
Member Author

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes-none Indicates a PR that does not require release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GetProxyServiceInstances has questionable logic
5 participants