This example shows that NSM annotations applied to namespace will be applied to the pods within this namespace.
NSC and NSE are using the kernel
mechanism to connect to its local forwarder.
Make sure that you have completed steps from basic or memory setup.
Create test namespace and deploy NSE:
kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/features/annotated-namespace?ref=7d9096404c273143d4925deaabb991e705909289
Wait for NSE to be ready:
kubectl wait --for=condition=ready --timeout=1m pod -l app=nse-kernel -n ns-annotated-namespace
Annotate namespace with NSM annotation:
kubectl annotate ns ns-annotated-namespace networkservicemesh.io=kernel://annotated-namespace/nsm-1
Apply client patch:
kubectl apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/7d9096404c273143d4925deaabb991e705909289/examples/features/annotated-namespace/client.yaml
Wait for client to be ready:
kubectl wait --for=condition=ready --timeout=1m pod -l app=alpine -n ns-annotated-namespace
Ping from NSC to NSE:
kubectl exec deployments/alpine -n ns-annotated-namespace -- ping -c 4 172.16.1.100
Ping from NSE to NSC:
kubectl exec deployments/nse-kernel -n ns-annotated-namespace -- ping -c 4 172.16.1.101
Delete ns:
kubectl delete ns ns-annotated-namespace