This example deploys Istio booking example with NSM.
This diagram shows that we have 2 clusters with NSM and also Istio deployed on the Cluster-2. As workloads there will be productpages on the first and second clusters. Each of the productpages requests the services it needs (review and details) according to Istio's example.
Both of these workloads are available to clients - for example, if we make a curl request to the productpage service, we can either get to Cluster-1 or Cluster-2.
This is achieved by adding istio-proxy-nse as an endpoint for the productpage Service and additional rules for iptables.
The required steps are listed below.
Make sure that you have completed steps from multiservicemesh
Install Istio for second cluster:
curl -sL https://istio.io/downloadIstioctl | sh -
export PATH=$PATH:$HOME/.istioctl/bin
istioctl install --readiness-timeout 10m0s --set profile=minimal -y --kubeconfig=$KUBECONFIG2
istioctl --kubeconfig=$KUBECONFIG2 proxy-statusInstall networkservice for the second cluster:
kubectl --kubeconfig=$KUBECONFIG2 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/94d55103486349a1df325371ac33207a98bd8569/examples/interdomain/usecases/nsm_istio_booking/netsvc.yamlStart productpage networkservicemesh client for the first cluster:
kubectl --kubeconfig=$KUBECONFIG1 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/94d55103486349a1df325371ac33207a98bd8569/examples/interdomain/usecases/nsm_istio_booking/productpage/productpage.yamlStart auto-scale networkservicemesh endpoint:
kubectl --kubeconfig=$KUBECONFIG2 apply -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/usecases/nsm_istio_booking/nse-auto-scale?ref=94d55103486349a1df325371ac33207a98bd8569Install istio booking example
kubectl --kubeconfig=$KUBECONFIG2 label namespace default istio-injection=enabled
kubectl --kubeconfig=$KUBECONFIG2 apply -f https://raw.githubusercontent.com/istio/istio/release-1.13/samples/bookinfo/platform/kube/bookinfo.yamlWait for the deploy/productpage-v1 client to be ready:
kubectl --kubeconfig=$KUBECONFIG1 wait --timeout=5m --for=condition=ready pod -l app=productpageGet curl for nsc:
kubectl --kubeconfig=$KUBECONFIG1 exec deploy/productpage-v1 -c cmd-nsc -- apk add curlVerify connectivity:
kubectl --kubeconfig=$KUBECONFIG1 exec deploy/productpage-v1 -c cmd-nsc -- curl -s productpage.default:9080/productpage | grep -o "<title>Simple Bookstore App</title>"Expected output is <title>Simple Bookstore App</title>
Congratulations! You have made a interdomain connection between two clusters via NSM + Istio!
kubectl --kubeconfig=$KUBECONFIG2 delete -f https://raw.githubusercontent.com/istio/istio/release-1.13/samples/bookinfo/platform/kube/bookinfo.yaml
kubectl --kubeconfig=$KUBECONFIG2 delete -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/usecases/nsm_istio_booking/nse-auto-scale?ref=94d55103486349a1df325371ac33207a98bd8569
kubectl --kubeconfig=$KUBECONFIG1 delete -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/94d55103486349a1df325371ac33207a98bd8569/examples/interdomain/usecases/nsm_istio_booking/productpage/productpage.yaml
kubectl --kubeconfig=$KUBECONFIG2 delete -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/94d55103486349a1df325371ac33207a98bd8569/examples/interdomain/usecases/nsm_istio_booking/netsvc.yaml
kubectl --kubeconfig=$KUBECONFIG2 delete ns istio-system
kubectl --kubeconfig=$KUBECONFIG2 label namespace default istio-injection-
kubectl --kubeconfig=$KUBECONFIG2 delete pods --all