This example shows that NSC and NSE on the one node can find each other.
NSC and NSE are using the kernel
mechanism to connect to its local forwarder.
Diagram:
Make sure that you have completed steps from basic or memory setup.
Create test namespace:
kubectl create ns ns-kernel2kernel
Deploy NSC and NSE:
kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/use-cases/Kernel2Kernel?ref=58a90eb58a3e06f02cbd99c221b35327488025cc
Wait for applications ready:
kubectl wait --for=condition=ready --timeout=1m pod -l app=alpine -n ns-kernel2kernel
kubectl wait --for=condition=ready --timeout=1m pod -l app=nse-kernel -n ns-kernel2kernel
Find nsc and nse pods by labels:
NSC=$(kubectl get pods -l app=alpine -n ns-kernel2kernel --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
NSE=$(kubectl get pods -l app=nse-kernel -n ns-kernel2kernel --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
Ping from NSC to NSE:
kubectl exec ${NSC} -n ns-kernel2kernel -- ping -c 4 172.16.1.100
Ping from NSE to NSC:
kubectl exec ${NSE} -n ns-kernel2kernel -- ping -c 4 172.16.1.101
Delete ns:
kubectl delete ns ns-kernel2kernel