diff --git a/examples/heal/README.md b/examples/heal/README.md new file mode 100644 index 000000000000..07c96039ed0f --- /dev/null +++ b/examples/heal/README.md @@ -0,0 +1,11 @@ +# Heal examples + +This document contain links for heal examples of NSM. + +## Requires + +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 diff --git a/examples/heal/local-forwarder-healing/README.md b/examples/heal/local-forwarder-healing/README.md new file mode 100644 index 000000000000..121236946a45 --- /dev/null +++ b/examples/heal/local-forwarder-healing/README.md @@ -0,0 +1,158 @@ +# Test local forwarder restart + +This example shows that NSM keeps working after the local Forwarder restart. + +NSC and NSE are using the `kernel` mechanism to connect to its local forwarder. + +## 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 +``` + +Select node to deploy NSC and NSE: +```bash +NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0]) +``` + +Create customization file: +```bash +cat > kustomization.yaml < patch-nsc.yaml < patch-nse.yaml <