This example demonstrates a more complex Network Service, where we chain three passthrough and one ACL Filtering NS endpoints. It demonstrates how NSM allows for service composition (chaining). It involves a combination of kernel and memif mechanisms, as well as VPP enabled endpoints.
Make sure that you have completed steps from basic or memory setup.
Deploy NSC and NSE:
kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/features/nse-composition?ref=7a2735f6f8c8ed02d058c1a6a2f04846a3d88cad
Wait for applications ready:
kubectl wait --for=condition=ready --timeout=5m pod -l app=alpine -n ns-nse-composition
kubectl wait --for=condition=ready --timeout=1m pod -l app=nse-kernel -n ns-nse-composition
Ping from NSC to NSE:
kubectl exec pods/alpine -n ns-nse-composition -- ping -c 4 172.16.1.100
Check TCP Port 8080 on NSE is accessible to NSC
kubectl exec pods/alpine -n ns-nse-composition -- wget -O /dev/null --timeout 5 "172.16.1.100:8080"
Check TCP Port 80 on NSE is inaccessible to NSC
kubectl exec pods/alpine -n ns-nse-composition -- wget -O /dev/null --timeout 5 "172.16.1.100:80"
if [ 0 -eq $? ]; then
echo "error: port :80 is available" >&2
false
else
echo "success: port :80 is unavailable"
fi
Ping from NSE to NSC:
kubectl exec deployments/nse-kernel -n ns-nse-composition -- ping -c 4 172.16.1.101
Delete ns:
kubectl delete ns ns-nse-composition