Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ambient: match multiple svc VIPs in waypoint #51939

Merged

Conversation

jewertow
Copy link
Member

@jewertow jewertow commented Jul 8, 2024

Please provide a description of this PR:

Fixes #51886

Istio will store all cluster VIPs for service entries, but these VIPs will be applied only to waypoint listeners for now - I will fix sidecars in a follow-up PR.

@istio-testing istio-testing added the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label Jul 8, 2024
@istio-testing
Copy link
Collaborator

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@istio-testing istio-testing added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 8, 2024
@jewertow
Copy link
Member Author

jewertow commented Jul 8, 2024

/test all

@jewertow
Copy link
Member Author

jewertow commented Jul 8, 2024

/test integ-ambient-ipv6

1 similar comment
@jewertow
Copy link
Member Author

jewertow commented Jul 8, 2024

/test integ-ambient-ipv6

@jewertow
Copy link
Member Author

jewertow commented Jul 8, 2024

/test integ-ambient

Signed-off-by: Jacek Ewertowski <[email protected]>
Signed-off-by: Jacek Ewertowski <[email protected]>
Signed-off-by: Jacek Ewertowski <[email protected]>
Signed-off-by: Jacek Ewertowski <[email protected]>
Signed-off-by: Jacek Ewertowski <[email protected]>
@jewertow jewertow force-pushed the match-multiple-svc-ips-in-waypoint branch from f162c2a to 391a4d1 Compare July 8, 2024 14:27
Signed-off-by: Jacek Ewertowski <[email protected]>
@jewertow
Copy link
Member Author

jewertow commented Jul 8, 2024

/test all

Signed-off-by: Jacek Ewertowski <[email protected]>
Signed-off-by: Jacek Ewertowski <[email protected]>
@jewertow jewertow changed the title networking: match multiple svc VIPs in waypoint ambient: match multiple svc VIPs in waypoint Jul 8, 2024
Signed-off-by: Jacek Ewertowski <[email protected]>
@jewertow
Copy link
Member Author

jewertow commented Jul 8, 2024

/test integ-ambient-ipv6

@jewertow jewertow marked this pull request as ready for review July 8, 2024 15:16
@jewertow jewertow requested review from a team as code owners July 8, 2024 15:16
@istio-testing istio-testing removed the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label Jul 8, 2024
@jewertow jewertow requested a review from howardjohn July 8, 2024 15:16
@jewertow
Copy link
Member Author

jewertow commented Jul 8, 2024

/test integ-ambient-ipv6

Copy link
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.

LGTM. Lets just change to sort and this is good to go

// between using DefaultAddress or ClusterVIPs[0] to create a listener.
notDefaultAddresses := sets.New[string](addresses...).Delete(ha.address)
addresses = []string{ha.address}
addresses = append(addresses, notDefaultAddresses.UnsortedList()...)
Copy link
Member

Choose a reason for hiding this comment

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

We should probably use a sorted list for stability. If we shuffle it everytime it can lead to constant XDS changes which is expensive. The list is virtually guaranteed to be short, so this should be acceptable performance

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, right. Thanks!

@@ -381,20 381,26 @@ func TestWaypointDNS(t *testing.T) {
if src.Config().HasSidecar() {
t.Skip("TODO: sidecars don't properly handle use-waypoint")
}
address := "240.240.240.239"
if _, v6 := getSupportedIPFamilies(t); v6 {
Copy link
Member

Choose a reason for hiding this comment

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

I think we can unconditionally put both. Did you see issues?

Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't try using both.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that putting both addresses can't work, because Address is used directly to build the URL, so it won't work with multiple addresses. I tried putting both to be sure that Go can't handle it and it was failing.

@@ -381,20 381,26 @@ func TestWaypointDNS(t *testing.T) {
if src.Config().HasSidecar() {
t.Skip("TODO: sidecars don't properly handle use-waypoint")
}
address := "240.240.240.239"
Copy link
Member

Choose a reason for hiding this comment

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

We can also fixup baseline_test L1742 and L1913

Copy link
Member Author

Choose a reason for hiding this comment

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

I will look at those tests.

@howardjohn howardjohn added the do-not-merge/hold Block automatic merging of a PR. label Jul 8, 2024
Copy link
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.

I'll approve, I put a hold for the sorting thing -- feel free to remove once addressed. Thanks!!

Signed-off-by: Jacek Ewertowski <[email protected]>
@jewertow jewertow removed the do-not-merge/hold Block automatic merging of a PR. label Jul 8, 2024
@istio-testing istio-testing merged commit 12c8284 into istio:master Jul 8, 2024
28 checks passed
@@ -1275,7 1275,7 @@ func (s *Service) GetExtraAddressesForProxy(node *Proxy) []string {
// GetAllAddressesForProxy returns a k8s service's extra addresses to the cluster where the node resides.
// Especially for dual stack k8s service to get other IP family addresses.
func (s *Service) GetAllAddressesForProxy(node *Proxy) []string {
if features.EnableDualStack && node.Metadata != nil && node.Metadata.ClusterID != "" {
if (features.EnableDualStack || features.EnableAmbient) && node.Metadata != nil && node.Metadata.ClusterID != "" {
Copy link
Member

Choose a reason for hiding this comment

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

features.EnableAmbient can violates EnableDualStack setting?

Copy link
Member Author

Choose a reason for hiding this comment

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

I would rather say that dual-stack is enabled by default in ambient mode.

Copy link
Member

Choose a reason for hiding this comment

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

It is a env, why cannot user turn it off

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know, I didn't add that condition.

@howardjohn
Copy link
Member

howardjohn commented Jul 9, 2024 via email

jewertow added a commit to jewertow/upstream-istio that referenced this pull request Jul 23, 2024
Signed-off-by: Jacek Ewertowski <[email protected]>
istio-testing pushed a commit that referenced this pull request Jul 26, 2024
…stener (#52283)

* networking: match multiple VIPs in sidecar outbound listener (#51967)

* networking: match multiple addresses in sidecar outbound listener

Signed-off-by: Jacek Ewertowski <[email protected]>

* Add unit tests for GetAllAddressesForProxy

Signed-off-by: Jacek Ewertowski <[email protected]>

* Refactor buildSidecarOutboundListener

Signed-off-by: Jacek Ewertowski <[email protected]>

* Add an integration test

Signed-off-by: Jacek Ewertowski <[email protected]>

* Add a release note

Signed-off-by: Jacek Ewertowski <[email protected]>

* Refactor GetAllAddressesForProxy

Signed-off-by: Jacek Ewertowski <[email protected]>

* Fix linter error

Signed-off-by: Jacek Ewertowski <[email protected]>

* Revert removal svcExtraListenAddresses variable

Signed-off-by: Jacek Ewertowski <[email protected]>

* Fix unit tests

Signed-off-by: Jacek Ewertowski <[email protected]>

* Refactoring

Signed-off-by: Jacek Ewertowski <[email protected]>

* Fix TestEDSOverlapping

Signed-off-by: Jacek Ewertowski <[email protected]>

* Skip testServiceEntryWithMultipleVIPs in ambient mode

Signed-off-by: Jacek Ewertowski <[email protected]>

* Fix TestEDSUnhealthyEndpoints

Signed-off-by: Jacek Ewertowski <[email protected]>

* Add test case for ServiceEntry with resolution NONE and multiple VIPs

Signed-off-by: Jacek Ewertowski <[email protected]>

* Fix lint error

Signed-off-by: Jacek Ewertowski <[email protected]>

* Fix linter errors

Signed-off-by: Jacek Ewertowski <[email protected]>

* Fix lint error

Signed-off-by: Jacek Ewertowski <[email protected]>

* Generate service with all ports

Signed-off-by: Jacek Ewertowski <[email protected]>

* do not create service instance for each hostname/address pair

Signed-off-by: Jacek Ewertowski <[email protected]>

* Refactor GetExtraAddressesForProxy and revert removal of its usage from buildSidecarOutboundListener

Signed-off-by: Jacek Ewertowski <[email protected]>

* Fix listenerBindings.Extra()

Signed-off-by: Jacek Ewertowski <[email protected]>

* Handle IPv6 prefix length

Signed-off-by: Jacek Ewertowski <[email protected]>

* Check address' family only if a proxy supports given family

Signed-off-by: Jacek Ewertowski <[email protected]>

* Update a comment

Signed-off-by: Jacek Ewertowski <[email protected]>

* Refactor getAllAddressesForProxy

Signed-off-by: Jacek Ewertowski <[email protected]>

---------

Signed-off-by: Jacek Ewertowski <[email protected]>

* Apply missing changes from #51939

Signed-off-by: Jacek Ewertowski <[email protected]>

* networking: fix DNS auto-allocation (#52147)

* Fix returning auto-allocated address

Signed-off-by: Jacek Ewertowski <[email protected]>

* Add an integration test

Signed-off-by: Jacek Ewertowski <[email protected]>

* Add missing build tag and license to dns_auto_allocation_test.go

Signed-off-by: Jacek Ewertowski <[email protected]>

* Fix unit tests

Signed-off-by: Jacek Ewertowski <[email protected]>

* Add workload selector to ProxyConfig

Signed-off-by: Jacek Ewertowski <[email protected]>

* Trigger injection if ProxyConfig was not propagated

Signed-off-by: Jacek Ewertowski <[email protected]>

---------

Signed-off-by: Jacek Ewertowski <[email protected]>

* Remove leftovers from conflict resolution

Signed-off-by: Jacek Ewertowski <[email protected]>

---------

Signed-off-by: Jacek Ewertowski <[email protected]>
luksa pushed a commit to luksa/istio that referenced this pull request Oct 14, 2024
* upstream/master:
  Concurrent xds cache benchmark (istio#51958)
  Fix TestController_ServiceWithChangingDiscoveryNamespaces flake (istio#51940)
  Allow setting seccomp profile type (e.g. `RuntimeDefault`) for waypoints (istio#51826)
  Automator: update proxy@master in istio/istio@master (istio#51931)
  istioctl - improve use of fancy icons (istio#51926)
  Automator: update common-files@master in istio/istio@master (istio#51961)
  Bump certifi from 2024.2.2 to 2024.7.4 in /samples/helloworld/src (istio#51949)
  Speedup isntall of multiple suites by up to 30s (istio#51948)
  ambient: add tests for components restarting (istio#51710)
  Enable dualStack cfg for istiod control plane in dualStack tests (istio#51844)
  Skip test setup for CNI skew test when we skip all tests (istio#51744)
  validation: add a few missed duration validations (istio#51946)
  Bump certifi in /samples/bookinfo/src/productpage (istio#51925)
  ambient: match multiple svc VIPs in waypoint (istio#51939)
  configure tls inspector initial buffer size (istio#51928)
  Be a bit more consistent with annotations in zt chart (istio#51692)
  update kiali addon to 1.87 (istio#51941)
  TestReachability: prune redundant test cases (istio#51924)
  Drop redundant test suite in security sds_ingress (istio#51923)
  Fix FuzzShallowcopyTrafficPolicy (istio#51916)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dual-stack area/networking size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support matching multiple IPs for one service in waypoint
5 participants