diff --git a/apps/nsc-kernel/nsc.yaml b/apps/nsc-kernel/nsc.yaml index 9014703a9502..2529a2446300 100644 --- a/apps/nsc-kernel/nsc.yaml +++ b/apps/nsc-kernel/nsc.yaml @@ -2,17 +2,17 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: nsc + name: nsc-kernel labels: - app: nsc + app: nsc-kernel spec: selector: matchLabels: - app: nsc + app: nsc-kernel template: metadata: labels: - app: nsc + app: nsc-kernel spec: containers: - name: nsc diff --git a/apps/nsc-memif/nsc.yaml b/apps/nsc-memif/nsc.yaml index 61bd04106922..44d3a9675525 100644 --- a/apps/nsc-memif/nsc.yaml +++ b/apps/nsc-memif/nsc.yaml @@ -2,17 +2,17 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: nsc + name: nsc-memif labels: - app: nsc + app: nsc-memif spec: selector: matchLabels: - app: nsc + app: nsc-memif template: metadata: labels: - app: nsc + app: nsc-memif spec: containers: - name: nsc diff --git a/apps/nsc-vfio/nsc.yaml b/apps/nsc-vfio/nsc.yaml index 6106054f213e..02bf9e9e2922 100644 --- a/apps/nsc-vfio/nsc.yaml +++ b/apps/nsc-vfio/nsc.yaml @@ -2,17 +2,17 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: nsc + name: nsc-vfio labels: - app: nsc + app: nsc-vfio spec: selector: matchLabels: - app: nsc + app: nsc-vfio template: metadata: labels: - app: nsc + app: nsc-vfio spec: containers: - name: pinger diff --git a/apps/nse-kernel/nse.yaml b/apps/nse-kernel/nse.yaml index 66b45b0f6c62..58a733f6a2ac 100644 --- a/apps/nse-kernel/nse.yaml +++ b/apps/nse-kernel/nse.yaml @@ -2,17 +2,17 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: nse + name: nse-kernel labels: - app: nse + app: nse-kernel spec: selector: matchLabels: - app: nse + app: nse-kernel template: metadata: labels: - app: nse + app: nse-kernel spec: containers: - name: nse diff --git a/apps/nse-memif/nse.yaml b/apps/nse-memif/nse.yaml index 8c68b34c9300..cb648c9f391f 100644 --- a/apps/nse-memif/nse.yaml +++ b/apps/nse-memif/nse.yaml @@ -2,17 +2,17 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: nse + name: nse-memif labels: - app: nse + app: nse-memif spec: selector: matchLabels: - app: nse + app: nse-memif template: metadata: labels: - app: nse + app: nse-memif spec: containers: - name: nse diff --git a/apps/nse-vfio/nse.yaml b/apps/nse-vfio/nse.yaml index dc0edcb58723..c162abc36d28 100644 --- a/apps/nse-vfio/nse.yaml +++ b/apps/nse-vfio/nse.yaml @@ -2,17 +2,17 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: nse + name: nse-vfio labels: - app: nse + app: nse-vfio spec: selector: matchLabels: - app: nse + app: nse-vfio template: metadata: labels: - app: nse + app: nse-vfio spec: hostNetwork: true containers: diff --git a/examples/features/.gitignore b/examples/features/.gitignore new file mode 100644 index 000000000000..69328c98acca --- /dev/null +++ b/examples/features/.gitignore @@ -0,0 +1,3 @@ +**/kustomization.yaml +**/patch-nsc.yaml +**/patch-nse.yaml \ No newline at end of file diff --git a/examples/features/ipv6/Kernel2Kernel/README.md b/examples/features/ipv6/Kernel2Kernel/README.md index b8e371f0f846..6778bb4d8fa9 100644 --- a/examples/features/ipv6/Kernel2Kernel/README.md +++ b/examples/features/ipv6/Kernel2Kernel/README.md @@ -54,7 +54,7 @@ cat > patch-nsc.yaml < patch-nse.yaml < patch-nsc.yaml < patch-nse.yaml < patch-nsc.yaml < patch-nse.yaml < kustomization.yaml < patch-nsc.yaml < patch-nse.yaml <&2 + echo "${out}" 1>&2 + return 1 + fi + + if ! pong_packets="$(echo "${out}" | grep "rx .* pong packets" | sed -E 's/rx ([0-9]*) pong packets/\1/g')"; then + cat "${err_file}" 1>&2 + echo "${out}" 1>&2 + return 1 + fi + + if [[ "${pong_packets}" == 0 ]]; then + cat "${err_file}" 1>&2 + echo "${out}" 1>&2 + return 1 + fi + + echo "${out}" + return 0 +} +``` + +Ping from kernel NSC to kernel NSE: +```bash +kubectl exec ${NSC_KERNEL} -n ${NAMESPACE} -- ping -c 4 172.16.1.100 +``` + +Ping from kernel NSE to kernel NSC: +```bash +kubectl exec ${NSE_KERNEL} -n ${NAMESPACE} -- ping -c 4 172.16.1.101 +``` + +Ping from VFIO NSC to VFIO NSE: +```bash +dpdk_ping +``` + +## Cleanup + +Stop ponger: +```bash +NSE_VFIO=$(kubectl get pods -l app=nse-vfio -n ${NAMESPACE} --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}') +``` +```bash +kubectl -n ${NAMESPACE} exec ${NSE_VFIO} --container ponger -- /bin/bash -c '\ + sleep 10 && kill $(pgrep "pingpong") 1>/dev/null 2>&1 & \ +' +``` + +Delete ns: +```bash +kubectl delete ns ${NAMESPACE} +``` \ No newline at end of file diff --git a/examples/use-cases/Kernel2Kernel/README.md b/examples/use-cases/Kernel2Kernel/README.md index f1fdf521e1a2..0d80aece8b62 100644 --- a/examples/use-cases/Kernel2Kernel/README.md +++ b/examples/use-cases/Kernel2Kernel/README.md @@ -58,7 +58,7 @@ cat > patch-nsc.yaml < patch-nse.yaml < patch-nsc.yaml < patch-nse.yaml < kustomization.yaml < patch-nsc.yaml < patch-nse.yaml <&2 + echo "${out}" 1>&2 + return 1 + fi + + if ! pong_packets="$(echo "${out}" | grep "rx .* pong packets" | sed -E 's/rx ([0-9]*) pong packets/\1/g')"; then + cat "${err_file}" 1>&2 + echo "${out}" 1>&2 + return 1 + fi + + if [[ "${pong_packets}" == 0 ]]; then + cat "${err_file}" 1>&2 + echo "${out}" 1>&2 + return 1 + fi + + echo "${out}" + return 0 +} +``` + +Ping from kernel NSC to kernel NSE: +```bash +kubectl exec ${NSC_KERNEL} -n ${NAMESPACE} -- ping -c 4 172.16.1.100 +``` + +Ping from kernel NSE to kernel NSC: +```bash +kubectl exec ${NSE_KERNEL} -n ${NAMESPACE} -- ping -c 4 172.16.1.101 +``` + +Ping from VFIO NSC to VFIO NSE: +```bash +dpdk_ping +``` + +## Cleanup + +Stop ponger: +```bash +NSE_VFIO=$(kubectl get pods -l app=nse-vfio -n ${NAMESPACE} --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}') +``` +```bash +kubectl -n ${NAMESPACE} exec ${NSE_VFIO} --container ponger -- /bin/bash -c '\ + sleep 10 && kill $(pgrep "pingpong") 1>/dev/null 2>&1 & \ +' +``` + +Delete ns: +```bash +kubectl delete ns ${NAMESPACE} +``` \ No newline at end of file diff --git a/examples/use-cases/Kernel2Vxlan2Kernel/README.md b/examples/use-cases/Kernel2Vxlan2Kernel/README.md index 29c2c7013287..7245b5c6004f 100644 --- a/examples/use-cases/Kernel2Vxlan2Kernel/README.md +++ b/examples/use-cases/Kernel2Vxlan2Kernel/README.md @@ -58,7 +58,7 @@ cat > patch-nsc.yaml < patch-nse.yaml < patch-nsc.yaml < patch-nse.yaml < patch-nsc.yaml < patch-nsc.yaml < patch-nse.yaml < patch-nsc.yaml < patch-nse.yaml < patch-nsc.yaml < patch-nse.yaml < patch-nsc.yaml < patch-nse.yaml <