This example shows that NSM keeps working after the Registry restart.
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.
Deploy NSC and NSE:
kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/heal/registry-restart/registry-before-death?ref=c91be29099fab1f8376d9ff90c858efd829de35e
Wait for applications ready:
kubectl wait --for=condition=ready --timeout=1m pod -l app=alpine -n ns-registry-restart
kubectl wait --for=condition=ready --timeout=1m pod -l app=nse-kernel -n ns-registry-restart
Find nsc and nse pods by labels:
NSC=$(kubectl get pods -l app=alpine -n ns-registry-restart --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
NSE=$(kubectl get pods -l app=nse-kernel -n ns-registry-restart --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
Ping from NSC to NSE:
kubectl exec pods/alpine -n ns-registry-restart -- ping -c 4 172.16.1.100
Ping from NSE to NSC:
kubectl exec deployments/nse-kernel -n ns-registry-restart -- ping -c 4 172.16.1.101
Find Registry:
REGISTRY=$(kubectl get pods -l app=registry -n nsm-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
Restart Registry and wait for it to start:
kubectl delete pod ${REGISTRY} -n nsm-system
kubectl wait --for=condition=ready --timeout=1m pod -l app=registry -n nsm-system
Apply a new client:
kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/heal/registry-restart/registry-after-death?ref=c91be29099fab1f8376d9ff90c858efd829de35e
Wait for a new NSC to start:
kubectl wait --for=condition=ready --timeout=1m pod -l app=alpine-new -n ns-registry-restart
Ping from new NSC to NSE:
kubectl exec pods/alpine-new -n ns-registry-restart -- ping -c 4 172.16.1.102
Ping from NSE to new NSC:
kubectl exec deployments/nse-kernel -n ns-registry-restart -- ping -c 4 172.16.1.103
Delete ns:
kubectl delete ns ns-registry-restart