This repository has been archived by the owner on Jul 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
envoy/permissive-mode: use cluster service discovery and routing (#1450)
When operating in permissive traffic policy mode, OSM relies on native kubernetes networking to route traffic to services. Since Kubernetes is already aware of how to discover and route traffic to services, rely on this instead of the control plane to explicitly program and discover endpoints. This change makes the controller logic simpler for permissive mode and is an optimization over the current implementation. Resolves #1403
- Loading branch information
1 parent
ca000a3
commit 15f41bc
Showing
6 changed files
with
79 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package cds | ||
|
||
import ( | ||
xds_cluster "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3" | ||
|
||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
|
||
"github.com/openservicemesh/osm/pkg/configurator" | ||
"github.com/openservicemesh/osm/pkg/tests" | ||
) | ||
|
||
var _ = Describe("Cluster configurations", func() { | ||
|
||
localService := tests.BookbuyerService | ||
remoteService := tests.BookstoreService | ||
Context("Test getRemoteServiceCluster", func() { | ||
It("Returns an EDS based cluster when permissive mode is disabled", func() { | ||
cfg := configurator.NewFakeConfiguratorWithOptions( | ||
configurator.FakeConfigurator{ | ||
PermissiveTrafficPolicyMode: false, | ||
}, | ||
) | ||
|
||
remoteCluster, err := getRemoteServiceCluster(remoteService, localService, cfg) | ||
Expect(err).ToNot(HaveOccurred()) | ||
Expect(remoteCluster.GetType()).To(Equal(xds_cluster.Cluster_EDS)) | ||
Expect(remoteCluster.LbPolicy).To(Equal(xds_cluster.Cluster_ROUND_ROBIN)) | ||
}) | ||
|
||
It("Returns an Original Destination based cluster when permissive mode is enabled", func() { | ||
cfg := configurator.NewFakeConfiguratorWithOptions( | ||
configurator.FakeConfigurator{ | ||
PermissiveTrafficPolicyMode: true, | ||
}, | ||
) | ||
|
||
remoteCluster, err := getRemoteServiceCluster(remoteService, localService, cfg) | ||
Expect(err).ToNot(HaveOccurred()) | ||
Expect(remoteCluster.GetType()).To(Equal(xds_cluster.Cluster_ORIGINAL_DST)) | ||
Expect(remoteCluster.LbPolicy).To(Equal(xds_cluster.Cluster_CLUSTER_PROVIDED)) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters