Ingress to Istio sidecar mesh with virtual destinations (GME)
Gloo Gateway to route traffic to Gloo Mesh Enterprise VirtualDestinations.
About Gloo Mesh Enterprise
Gloo Mesh Enterprise is a service mesh management plane that is based on hardened, open-source projects like Envoy and Istio. With Gloo Mesh, you can unify the configuration, operation, and visibility of service-to-service connectivity across your distributed applications. These apps can run in different virtual machines (VMs) or Kubernetes clusters on premises or in various cloud providers, and even in different service meshes.
About VirtualDestinations
A VirtualDestination is a traffic management concept in Gloo Mesh Enterprise that allows you to define unique internal hostnames for services that are spread across a multicluster service mesh. Without VirtualDestinations, you must update the IP addresses of your services every time the IP address changes, such as when you update your app or deploy a new version. Because a VirtualDestination uses labels to select the backing services, it can automatically detect IP address changes and update them for you.
To learn more about VirtualDestinations, see the VirtualDestinations conceptual overview and multicluster routing guide in the Gloo Mesh Enterprise documentation.
About this guide
In this guide, you explore how to use Gloo Mesh Enterprise and Gloo Gateway together to route traffic to Bookinfo services that are spread across clusters. Bookinfo is a sample microservices-based app that is provided by Istio and composed of 4 different microservices that interact with each other. The app is commonly used to to demonstrate Istio’s service mesh features and capabilities.
To accomplish multicluster routing with Gloo Gateway and Gloo Mesh Enterprise, you leverage VirtualDestinations. You can use VirtualDestinations in multiple ways in Gloo Gateway. This guide provides steps to accomplish the following tasks:
Step 1: Install Gloo Mesh Enterprise
Install Gloo Mesh Enterprise by following the multicluster getting started tutorial in the Gloo Mesh Enterprise documentation. This guide creates a three-cluster setup with one management cluster that runs the Gloo Mesh Enterprise control plane and two workload clusters that run the data plane. You also install a Solo distribution of Istio in both of your workload clusters by using the IstioLifecycleManager.
Deploy the sample Bookinfo app. You use this app to demonstrate traffic routing in a multicluster service mesh. You can optionally install other sample apps, such as httpbin or helloworld. However, these apps are not used in this guide.
Set up multicluster routing for the
reviews
app by using a VirtualDestination and RouteTable resource. Make sure that the productpage app can route traffic to all versions of thereviews
app before you continue with installing Gloo Gateway.Review the VirtualDestination that you created in the previous step. The VirtualDestination specifies the
reviews.mesh.internal.com
internal hostname that services in the mesh can use to reach all instances of the reviews app.Example output:
Step 2: Install Gloo Gateway
After you successfully installed Gloo Mesh Enterprise and confirmed that you can route traffic from the product page app to all versions of the reviews app, you can now continue to install Gloo Gateway. Gloo Gateway must be installed in a cluster that also has Istio installed. You can choose to install Gloo Gateway in one or each of your workload clusters.
This guide assumes that you want to install Gloo Gateway in workload cluster 1.
Set your Gloo Gateway license key as an environment variable. If you do not have one, contact an account representative.
Install the custom resources of the Kubernetes Gateway API. To use VirtualDestinations with Gloo Gateway, you must install the experimental channel of version 1.2.0.
Example output:
Get the name of the istiod service. Depending on how you set up Istio, you might see a revisionless service name (istiod) or a service name with a revision, such as istiod-1-22.
Example output:
Derive the Kubernetes service address for your istiod deployment. The service address uses the format
<service-name>.<namespace>.svc:15012
. For example, if your service name is istiod-1-22, the full service address isistiod-1-22.istio-system.svc:15012
.Install Gloo Gateway and enable the Istio integration.
Add the Helm repository for Gloo Gateway Enterprise Edition.
Install Gloo Gateway Enterprise Edition. This command creates the
gloo-system
namespace and installs the Gloo Gateway control plane into it. Replace the following values:istioDiscoveryAddress
: Set<istiod-service-address>
to the istiod service address that you retrieved earlier.istioMetaClusterId
: ThetrustDomain
that was set in the IstioOperator for istiod. If you followed the getting started tutorial in the Gloo Mesh Enterprise documentation, you must set this value to the name of your workload cluster.istioMetaMeshId
: ThemeshID
that was set in the IstioOperator for istiod. If you followed the getting started tutorial in the Gloo Mesh Enterprise documentation, you must set this value to the name of your workload cluster.
Example output:
Verify that the Gloo Gateway control plane is up and running.
Example output:
Verify that the
gloo-gateway
GatewayClass is created. You can optionally take a look at how the gateway class is configured by adding the-o yaml
option to your command.Example output:
Step 3: Create a gateway proxy
Create a gateway resource and configure an HTTP listener. The following gateway can serve HTTP resources from all namespaces.
Verify that the gateway is created successfully. You can also review the external address that is assigned to the gateway. Note that depending on your environment it might take a few minutes for the load balancer service to be assigned an external address.
Example output:
Check the gateway proxy pod that is created for you. Make sure that you see three containers in your pod (
istio-proxy
,sds
, andgloo-gateway
).If your gateway proxy is stuck and goes into a CrashLoopBackoff status, review the logs of theistio-proxy
andsds
containers. You might need to change the Istio values that you provided in your Gloo Gateway Helm installation to point to the correct addresses.Example output:
Get the address of your gateway proxy and save it in an environment variable.
Step 4: Expose the product page app
In this step, you expose the product page app in the gateway proxy. The product page app uses the VirtualDestination that you created as part of step 1 to route traffic to all instances of the reviews app.
Set up an HTTPRoute that exposes a route to the productpage app.
Open the product page in your web browser.
Refresh the page a few times. Because you have the Gloo Mesh Enterprise RouteTable in place, the product page round robins through all the reviews instances in workload clusters 1 and 2 by using the VirtualDestination. Make sure that you see all three versions of the reviews app: black stars, no stars, and red stars.
Step 5: Route to a VirtualDestination
In this step, you expose the VirtualDestination for the reviews app on your gateway proxy directly. When you send a request to the reviews app, the gateway proxy now uses the internal hostname that was defined in the VirtualDestination to reach all instances of the reviews app.
Create an HTTPRoute for the reviews app that references the VirtualDestination in your
backendRefs
. In order for the HTTPRoute to match the VirtualDestination, you use the hostname that your VirtualDestination is exposed on. Note that this hostname must match the hostname that is defined in the ServiceEntry resource that is automatically created by Gloo Mesh Enterprise during the translation of your VirtualDestination.To view the ServiceEntry that was created for you, runkubectl get serviceentry -n bookinfo -o yaml
. Note that the ServiceEntry must list thegloo-system
namespace in thespec.exportTo
settings for the VirtualDestination integration to work properly. If you do not see thegloo-system
namespace, check the Gloo Mesh Enterprise workspace and workspace settings on your cluster.Send multiple requests to the reviews app directly. Make sure that you get back a response from all the reviews app instances.
Example output:
Great job! You successfully exposed a VirtualDestination on your gateway and routed traffic to app instances that are spread across clusters.
Cleanup
You can optionally remove the resources that you created.
Follow the Uninstall guide in the Gloo Mesh Enterprise documentation to remove Gloo Mesh Enterprise.
Follow the upgrade guide to upgrade your Gloo Gateway Helm installation values and disable the Istio integration.
Remove the HTTPRoutes for the product page and reviews app.