Skip to content

Latest commit

 

History

History
 
 

nsm_istio_booking

NSM + Istio interdomain example

This example deploys Istio booking example with NSM.

NSM  interdomain Scheme

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.

Requires

Make sure that you have completed steps from multiservicemesh

Run

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/34e1f2476dbc21097ab0a50348a966fd58b79985/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/34e1f2476dbc21097ab0a50348a966fd58b79985/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=34e1f2476dbc21097ab0a50348a966fd58b79985

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!

Cleanup

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=34e1f2476dbc21097ab0a50348a966fd58b79985 
kubectl --kubeconfig=$KUBECONFIG1 delete -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/34e1f2476dbc21097ab0a50348a966fd58b79985/examples/interdomain/usecases/nsm_istio_booking/productpage/productpage.yaml
kubectl --kubeconfig=$KUBECONFIG2 delete -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/34e1f2476dbc21097ab0a50348a966fd58b79985/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