From f9de92b68411a354a7144e693f1e7a2a447796c8 Mon Sep 17 00:00:00 2001 From: Vladimir Popov Date: Thu, 10 Jun 2021 11:10:16 +0700 Subject: [PATCH] Add NSMgr restart cases Signed-off-by: Vladimir Popov --- examples/heal/README.md | 6 +- examples/heal/local-nsmgr-restart/README.md | 156 +++++++++++++++++++ examples/heal/remote-nsmgr-restart/README.md | 156 +++++++++++++++++++ 3 files changed, 316 insertions(+), 2 deletions(-) create mode 100644 examples/heal/local-nsmgr-restart/README.md create mode 100644 examples/heal/remote-nsmgr-restart/README.md diff --git a/examples/heal/README.md b/examples/heal/README.md index 07c96039ed0f..34112876a222 100644 --- a/examples/heal/README.md +++ b/examples/heal/README.md @@ -1,6 +1,6 @@ # Heal examples -This document contain links for heal examples of NSM. +This document contains links for heal examples of NSM. ## Requires @@ -8,4 +8,6 @@ To run any heal example follow steps for [Basic NSM setup](../basic) ## Includes -- [Local Forwarder restart](./local-forwarder-healing) \ No newline at end of file +- [Local Forwarder restart](./local-forwarder-healing) +- [Local NSMgr restart](./local-nsmgr-restart) +- [Remote NSMgr restart](./remote-nsmgr-restart) diff --git a/examples/heal/local-nsmgr-restart/README.md b/examples/heal/local-nsmgr-restart/README.md new file mode 100644 index 000000000000..b1300e09d860 --- /dev/null +++ b/examples/heal/local-nsmgr-restart/README.md @@ -0,0 +1,156 @@ +# Local NSMgr restart + +This example shows that NSM keeps working after the local NSMgr restart. + +NSC and NSE are using the `kernel` mechanism to connect to its local forwarder. +Forwarders are using the `vxlan` mechanism to connect with each other. + +## Requires + +Make sure that you have completed steps from [basic](../../basic) or [memory](../../memory) setup. + +## Run + +Create test namespace: +```bash +NAMESPACE=($(kubectl create -f ../namespace.yaml)[0]) +NAMESPACE=${NAMESPACE:10} +``` + +Register namespace in `spire` server: +```bash +kubectl exec -n spire spire-server-0 -- \ +/opt/spire/bin/spire-server entry create \ +-spiffeID spiffe://example.org/ns/${NAMESPACE}/sa/default \ +-parentID spiffe://example.org/ns/spire/sa/spire-agent \ +-selector k8s:ns:${NAMESPACE} \ +-selector k8s:sa:default +``` + +Get nodes exclude control-plane: +```bash +NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')) +``` + +Create customization file: +```bash +cat > kustomization.yaml < patch-nsc.yaml < patch-nse.yaml < kustomization.yaml < patch-nsc.yaml < patch-nse.yaml <