Skip to content

Latest commit

 

History

History
 
 

local-nsmgr-local-nse-memif

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Local NSMgr + Local NSE restart

This example shows that NSM keeps working after the local NSMgr + local NSE restart.

NSC and NSE are using the memif mechanism to connect with each other.

Requires

Make sure that you have completed steps from basic or memory setup.

Run

Deploy NSC and NSE:

kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/heal/local-nsmgr-local-nse-memif/nse-before-death?ref=aad7c26ad32fb4c3b515179bbe85d59c811c52f1

Wait for applications ready:

kubectl wait --for=condition=ready --timeout=1m pod -l app=nsc-memif -n ns-local-nsmgr-local-nse-memif
kubectl wait --for=condition=ready --timeout=1m pod -l app=nse-memif -n ns-local-nsmgr-local-nse-memif

Ping from NSC to NSE:

result=$(kubectl exec deployments/nsc-memif -n ns-local-nsmgr-local-nse-memif -- vppctl ping 172.16.1.100 repeat 4)
echo ${result}
! echo ${result} | grep -E -q "(100% packet loss)|(0 sent)|(no egress interface)"

Ping from NSE to NSC:

result=$(kubectl exec deployments/nse-memif -n ns-local-nsmgr-local-nse-memif -- vppctl ping 172.16.1.101 repeat 4)
echo ${result}
! echo ${result} | grep -E -q "(100% packet loss)|(0 sent)|(no egress interface)"

Delete the previous NSE:

kubectl delete deployment nse-memif -n ns-local-nsmgr-local-nse-memif

Find nsc node:

NSC_NODE=$(kubectl get pods -l app=nsc-memif -n ns-local-nsmgr-local-nse-memif --template '{{range .items}}{{.spec.nodeName}}{{"\n"}}{{end}}')

Find local NSMgr pod:

NSMGR=$(kubectl get pods -l app=nsmgr --field-selector spec.nodeName==${NSC_NODE} -n nsm-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')

Restart local NSMgr and NSE:

kubectl delete pod ${NSMGR} -n nsm-system
kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/heal/local-nsmgr-local-nse-memif/nse-after-death?ref=aad7c26ad32fb4c3b515179bbe85d59c811c52f1

Waiting for new ones:

kubectl wait --for=condition=ready --timeout=1m pod -l app=nsmgr --field-selector spec.nodeName==${NSC_NODE} -n nsm-system
kubectl wait --for=condition=ready --timeout=1m pod -l app=nse-memif -l version=new -n ns-local-nsmgr-local-nse-memif

Find new NSE pod:

NEW_NSE=$(kubectl get pods -l app=nse-memif -l version=new -n ns-local-nsmgr-local-nse-memif --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')

Ping from NSC to NSE:

result=$(kubectl exec deployments/nsc-memif -n ns-local-nsmgr-local-nse-memif -- vppctl ping 172.16.1.102 repeat 4)
echo ${result}
! echo ${result} | grep -E -q "(100% packet loss)|(0 sent)|(no egress interface)"

Ping from NSE to NSC:

result=$(kubectl exec "${NEW_NSE}" -n "ns-local-nsmgr-local-nse-memif" -- vppctl ping 172.16.1.103 repeat 4)
echo ${result}
! echo ${result} | grep -E -q "(100% packet loss)|(0 sent)|(no egress interface)"

Cleanup

Delete ns:

kubectl delete ns ns-local-nsmgr-local-nse-memif