diff --git a/examples/calico/README.md b/examples/calico/README.md new file mode 100644 index 000000000000..8cc9fe10b561 --- /dev/null +++ b/examples/calico/README.md @@ -0,0 +1,58 @@ +# Calico examples + +Contain calico setup for NSM. + +## Requires + +- [spire](../spire) + +## Includes + +- [Memif to Memif Connection](../use-cases/Memif2Memif) +- [Kernel to Kernel Connection](../use-cases/Kernel2Kernel) +- [Kernel to Memif Connection](../use-cases/Kernel2Memif) +- [Memif to Kernel Connection](../use-cases/Memif2Kernel) +- [Kernel to VXLAN to Kernel Connection](../use-cases/Kernel2Vxlan2Kernel) +- [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) +- [Kernel to Kernel IPv6](../features/ipv6/Kernel2Kernel) +- [Kernel to Wireguard to Kernel IPv6](../features/ipv6/Kernel2Wireguard2Kernel) +- [Kernel to Wireguard to Memif IPv6](../features/ipv6/Kernel2Wireguard2Memif) +- [Memif to Memif IPv6](../features/ipv6/Memif2Memif) +- [Memif to Wireguard to Kernel IPv6](../features/ipv6/Memif2Wireguard2Kernel) +- [Memif to Wireguard to Memif IPv6](../features/ipv6/Memif2Wireguard2Memif) +- [Nse composition](../features/nse-composition) + +## Run + +1. Create ns for deployments: +```bash +kubectl create ns nsm-system +``` + +2. Apply NSM resources for calico tests: + +```bash +kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/calico/?ref=bbe46ecf104280e96ae3a32d4757149e792f0d11 +``` + +3. Wait for admission-webhook-k8s: + +```bash +WH=$(kubectl get pods -l app=admission-webhook-k8s -n nsm-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}') +kubectl wait --for=condition=ready --timeout=1m pod ${WH} -n nsm-system +``` + +## Cleanup + +To free resouces follow the next command: + +```bash +kubectl delete mutatingwebhookconfiguration --all +kubectl delete ns nsm-system +``` diff --git a/examples/calico/calico-patch.yaml b/examples/calico/calico-patch.yaml new file mode 100644 index 000000000000..2e2464a94a27 --- /dev/null +++ b/examples/calico/calico-patch.yaml @@ -0,0 +1,24 @@ +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: forwarder-vpp +spec: + template: + spec: + hostPID: true + containers: + - name: forwarder-vpp + env: + - name: NSM_VPP_API_SOCKET + value: /var/run/vpp/vpp-api.sock + - name: NSM_VPP_INIT + value: NONE + volumeMounts: + - name: vpp + mountPath: /var/run/vpp + volumes: + - name: vpp + hostPath: + path: /var/run/vpp + type: Directory diff --git a/examples/calico/calico-vpp-dataplane/calico-vpp-patch.yaml b/examples/calico/calico-vpp-dataplane/calico-vpp-patch.yaml new file mode 100644 index 000000000000..adf9f207142c --- /dev/null +++ b/examples/calico/calico-vpp-dataplane/calico-vpp-patch.yaml @@ -0,0 +1,8 @@ +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: calico-vpp-config + namespace: calico-vpp-dataplane +data: + vpp_dataplane_interface: eno2 diff --git a/examples/calico/calico-vpp-dataplane/kustomization.yaml b/examples/calico/calico-vpp-dataplane/kustomization.yaml new file mode 100644 index 000000000000..293e6fcd9165 --- /dev/null +++ b/examples/calico/calico-vpp-dataplane/kustomization.yaml @@ -0,0 +1,9 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - https://raw.githubusercontent.com/projectcalico/vpp-dataplane/v0.17.0-calicov3.20.2/yaml/generated/calico-vpp-nohuge.yaml + +patchesStrategicMerge: + - calico-vpp-patch.yaml diff --git a/examples/calico/kustomization.yaml b/examples/calico/kustomization.yaml new file mode 100644 index 000000000000..c0111d4ce57e --- /dev/null +++ b/examples/calico/kustomization.yaml @@ -0,0 +1,9 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +bases: + - ../basic + +patchesStrategicMerge: + - calico-patch.yaml