Deploy applications on multiple clusters
After you have one or more clusters attached to the mesh, here are some best practices to deploy applications on multiple clusters.
Deploy demo application
If you just want to get started with any demo application in a multi-cluster mesh, the easiest is to install the built-in Service Mesh Manager demo application.
You can deploy the demo application in a distributed way to multiple clusters with the following commands:
smm demoapp install -s frontpage,catalog,bookings smm -c <PEER_CLUSTER_KUBECONFIG_FILE> demoapp install -s movies,payments,notifications,analytics,database --peer
After installation, the demo application automatically starts generating traffic, and the dashboard draws a picture of the data flow. (If if doesn’t, run the
smm demoapp load startcommand, or Generate load on the UI. If you want to stop generating traffic, run
smm demoapp load stop.)
Open the dashboard and look around.
Deploy custom application
Here is how you can deploy your own application on multiple clusters with Service Mesh Manager.
Create the namespace where you would like to run your applications on every cluster:
kubectl create ns test
In the cluster where Service Mesh Manager is installed, enable sidecar injection in that namespace:
smm sidecar-proxy auto-inject on test
This will place an
istio.io/revlabel and set it to the appropriate Istio control plane (if there are multiple control planes, you get to choose which one). (The sidecar injection can be enabled from the Service Mesh Manager dashboard as well.)
Service Mesh Manager, more particularly the Istio operator, will take care of adding the same label to this namespace on all other clusters. (If not, check the istio-operator pod logs on the particular cluster for any potential issues.)
Deploy your application on the clusters as you would usually do:
One caveat is that you should deploy all kubernetes
serviceresources on all clusters even if pods are only present on a subset of clusters. This is needed for Istio to be able to do proper routing across clusters.
Make sure that sidecar pods are indeed injected to your application pods.
If not, check the official Istio documentation for potential issues.
Send traffic to your applications, then open the dashboard and look around.