Connectivity and Failover between Clusters
Tetrate makes it easy for the App Owner to deploy an application across multiple clusters. East-West gateways can be deployed in selected Workspaces, and expose some or all services to other clusters. Tetrate's central Service Registry is used to then create virtual endpoints (ServiceEntries) for these exposed services in other clusters, so that clients can discover and consume these services exactly as if they were running locally.
This capability can be used to:
- Distribute components of an application across different clusters
- Access centralized, shared services such as a Database microservice from remote clusters
- Provide Failover between instances of services across different clusters
- Simplify testing by ensuring that the same application and addressing scheme works in one cluster, or distributed across multiple
The Platform Owner ("Platform") prepares the platform for failover use cases, and the Application Owner ("Apps") can take advantage of these capabilities with minimal modification to their workflow.
The Platform Owner will prepare the platform as follows:
Deploy an East-West Gateway
Deploy an East-West Gateway in the namespace containing services to be shared.
Update the Workspace to expose the required services
Update the Workspace to expose the required services so that they can be discovered and used on other clusters.
Deploy East-West Gateways for Internal Failover
Deploy additional East-West Gateways in other clusters for service failover.
The Application Owner can then:
Access the Exposed Services
Access the Exposed Services from other clusters.
Test Failover across Clusters
Verify that services can failover from one cluster to a backup instance in another cluster.
Platform: Before you begin
Before you begin, you will need to know:
- The Workspace where the shared services are located
- Which services should be exposed; by default, all services within the Workspace are exposed
You can also review the TSE Getting Started use cases: High Availability and Cross-Cluster Communications.
Platform: Deploy an East-West Gateway
Deploy an East-West Gateway in the namespace containing services to be shared:
cat <<EOF > eastwest-gateway.yaml
apiVersion: install.tetrate.io/v1alpha1
kind: IngressGateway
metadata:
name: eastwest-gateway
namespace: bookinfo
spec:
eastWestOnly: true
EOF
kubectl apply -f eastwest-gateway.yaml
List the East-West Gateways running in the local cluster:
kubectl get pods -A -l app=eastwest-gateway
Platform: Update the Workspace to expose the required services
Update the WorkspaceSettings associated with the Workspace:
cat <<EOF > bookinfo-settings.yaml
apiVersion: api.tsb.tetrate.io/v2
kind: WorkspaceSetting
metadata:
name: bookinfo-ws-settings
workspace: bookinfo-ws
tenant: tse
organization: tse
spec:
defaultSecuritySetting:
authenticationSettings:
trafficMode: REQUIRED
authorization:
mode: WORKSPACE
defaultEastWestGatewaySettings:
- workloadSelector:
namespace: bookinfo
labels:
app: eastwest-gateway
exposedServices:
- serviceLabels:
app: details
- serviceLabels:
app: reviews
EOF
tctl apply -f bookinfo-settings.yaml
Note how the defaultEastWestGatewaySettings uses workloadSelector to identify the EastWest Gateway, and has an optional exposedServices stanza.
The Application Owner can discover and consume these shared services from the remote cluster. They are exposed as ServiceEntries in the xcp-multicluster namespace, and use the same FQDN as in the first cluster:
kubectl get serviceentry -n xcp-multicluster
Note that if the Application Owner deploys the same services in the remote cluster, then the Tetrate control plane will then remove the ServiceEntries so that clients in that cluster prefer service instances in the same cluster.