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-status
Install networkservice for the second cluster:
kubectl --kubeconfig=$KUBECONFIG2 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/7a2735f6f8c8ed02d058c1a6a2f04846a3d88cad/examples/interdomain/usecases/nsm_istio_booking/netsvc.yaml
Start productpage
networkservicemesh client for the first cluster:
kubectl --kubeconfig=$KUBECONFIG1 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/7a2735f6f8c8ed02d058c1a6a2f04846a3d88cad/examples/interdomain/usecases/nsm_istio_booking/productpage/productpage.yaml
Start 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=7a2735f6f8c8ed02d058c1a6a2f04846a3d88cad
Install 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.yaml
Wait for the deploy/productpage-v1 client to be ready:
kubectl --kubeconfig=$KUBECONFIG1 wait --timeout=5m --for=condition=ready pod -l app=productpage
Get curl for nsc:
kubectl --kubeconfig=$KUBECONFIG1 exec deploy/productpage-v1 -c cmd-nsc -- apk add curl
Verify 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=7a2735f6f8c8ed02d058c1a6a2f04846a3d88cad
kubectl --kubeconfig=$KUBECONFIG1 delete -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/7a2735f6f8c8ed02d058c1a6a2f04846a3d88cad/examples/interdomain/usecases/nsm_istio_booking/productpage/productpage.yaml
kubectl --kubeconfig=$KUBECONFIG2 delete -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/7a2735f6f8c8ed02d058c1a6a2f04846a3d88cad/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