The example demonstrates how can be declareded forwarder selection in network service.
Important points:
- client requests
select-forwarder
service. - forwarder registers itself with label
my_forwarder_capability: true
- network service declaretes network service
select-forwarder
that contains match for labelmy_forwarder_capability: true
- network service-endpoint registers as an endpoint for service
select-forwarder
See at example resources in kustomization.yaml
Make sure that you have completed steps from basic setup.
Apply example resources:
kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/features/select-forwarder?ref=34e1f2476dbc21097ab0a50348a966fd58b79985
Wait for applications ready:
kubectl wait --for=condition=ready --timeout=1m pod -l app=alpine -n ns-select-forwarder
kubectl wait --for=condition=ready --timeout=1m pod -l app=nse-kernel -n ns-select-forwarder
Ping from NSC to NSE:
kubectl exec pods/alpine -n ns-select-forwarder -- ping -c 4 169.254.0.0
Ping from NSE to NSC:
kubectl exec deployments/nse-kernel -n ns-select-forwarder -- ping -c 4 169.254.0.1
Verify that NSMgr selected the correct forwarder:
kubectl logs pods/alpine -c cmd-nsc -n ns-select-forwarder | grep "my-forwarder-vpp"
kubectl delete ns ns-select-forwarder