diff --git a/examples/basic/README.md b/examples/basic/README.md index 74b60efe972b..0b95af979bfb 100644 --- a/examples/basic/README.md +++ b/examples/basic/README.md @@ -16,6 +16,10 @@ Contain basic setup for NSM that includes `nsmgr`, `forwarder-vpp`, `registry-k8 - [Memif to VXLAN to Memif Connection](../use-cases/Memif2Vxlan2Memif) - [Kernel to VXLAN to Memif Connection](../use-cases/Kernel2Vxlan2Memif) - [Memif to VXLAN to Kernel Connection](../use-cases/Memif2Vxlan2Kernel) +- [Kernel to Wireguard to Kernel Connection](../use-cases/Kernel2Wireguard2Kernel) +- [Memif to Wireguard to Memif Connection](../use-cases/Memif2Wireguard2Memif) +- [Kernel to Wireguard to Memif Connection](../use-cases/Kernel2Wireguard2Memif) +- [Memif to Wireguard to Kernel Connection](../use-cases/Memif2Wireguard2Kernel) ## Run diff --git a/examples/use-cases/Kernel2Wireguard2Kernel/README.md b/examples/use-cases/Kernel2Wireguard2Kernel/README.md new file mode 100644 index 000000000000..b01dea6f7f55 --- /dev/null +++ b/examples/use-cases/Kernel2Wireguard2Kernel/README.md @@ -0,0 +1,135 @@ +# Test kernel to wireguard to kernel connection + +This example shows that NSC and NSE on the different nodes could find and work with each other. + +NSC and NSE are using the `kernel` mechanism to connect to its local forwarder. +Forwarders are using the `wireguard` 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 < kustomization.yaml < patch-nsc.yaml < patch-nse.yaml < kustomization.yaml < patch-nsc.yaml < patch-nse.yaml <