diff --git a/examples/features/README.md b/examples/features/README.md index 50868b1daf80..32e727e72303 100644 --- a/examples/features/README.md +++ b/examples/features/README.md @@ -9,6 +9,8 @@ To run any feature example follow steps for [Basic NSM setup](../basic) ## Includes - [Simple OPA example](./opa) +- [Kernel2Kernel IPv6 example](./ipv6/Kernel2Kernel) +- [Memif2Memif IPv6 example](./ipv6/Memif2Memif) - Heal - Refresh - Timeout diff --git a/examples/features/ipv6/Kernel2Kernel/README.md b/examples/features/ipv6/Kernel2Kernel/README.md new file mode 100644 index 000000000000..b8e371f0f846 --- /dev/null +++ b/examples/features/ipv6/Kernel2Kernel/README.md @@ -0,0 +1,128 @@ +# Test kernel to kernel connection + + +This example shows that NSC and NSE on the one node can find each other by ipv6 addresses. + +NSC and NSE are using the `kernel` mechanism to connect to its local forwarder. + +## 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 < kustomization.yaml < patch-nsc.yaml < patch-nse.yaml <