diff --git a/apps/nse-remote-vlan/nse-remote-vlan.yaml b/apps/nse-remote-vlan/nse-remote-vlan.yaml index d9070b785bd1..daf1abff5002 100644 --- a/apps/nse-remote-vlan/nse-remote-vlan.yaml +++ b/apps/nse-remote-vlan/nse-remote-vlan.yaml @@ -32,7 +32,7 @@ spec: - name: NSM_CONNECT_TO value: "registry:5002" - name: NSM_SERVICES - value: "finance-bridge { vlan: 100; via: gw1}" + value: "finance-bridge { vlan: 100; via: gw1}, private-bridge { vlan: 200; via: gw1 }" - name: NSM_CIDR_PREFIX value: "172.10.0.0/24" - name: NSM_IPV6_PREFIX diff --git a/examples/remotevlan/README.md b/examples/remotevlan/README.md index 0c24805af1e6..8f75ff2821be 100644 --- a/examples/remotevlan/README.md +++ b/examples/remotevlan/README.md @@ -1,6 +1,6 @@ # NSM Remote Vlan Examples -This setup can be used to check remote vlan mechanism. Contain basic setup for NSM that includes `nsmgr`, `registry-k8s`, `admission-webhook-k8s`, `nse-remote-vlan`. The `nse-remote-vlan` belongs to the nsm-system since does not have role in data-plane connection. +This setup can be used to check remote vlan mechanism with both OVS and VPP forwarder. Contain basic setup for NSM that includes `nsmgr`, `registry-k8s`, `admission-webhook-k8s`, `nse-remote-vlan`. The `nse-remote-vlan` belongs to the nsm-system since does not have role in data-plane connection. ## Requires @@ -8,6 +8,7 @@ This setup can be used to check remote vlan mechanism. Contain basic setup for N ## Includes +- [Remote VLAN mechanism using forwarder-ovs](./rvlanovs) - [Remote VLAN mechanism using forwarder-vpp](./rvlanvpp) ## Run diff --git a/examples/remotevlan/rvlanovs/README.md b/examples/remotevlan/rvlanovs/README.md new file mode 100644 index 000000000000..f726887e3fd4 --- /dev/null +++ b/examples/remotevlan/rvlanovs/README.md @@ -0,0 +1,35 @@ +# NSM Remote Vlan OVS Forwarder + +Contains setup for `forwarder-ovs` and device configuration file for remote vlan mechanism. + +## Requires + +Make sure that you have completed steps from [remotevlan](../../remotevlan) setup. + +## Includes + +- [Kernel2RVlanInternal](../../use-cases/Kernel2RVlanInternal) +- [Kernel2RVlanBreakout](../../use-cases/Kernel2RVlanBreakout) +- [Kernel2RVlanMultiNS](../../use-cases/Kernel2RVlanMultiNS) + +## Run + +Deploy the forwarder: + +```bash +kubectl apply -k . +``` + +Wait forwarder to start: + +```bash +kubectl -n nsm-system wait --for=condition=ready --timeout=2m pod -l app=forwarder-ovs +``` + +## Cleanup + +Delete the forwarder: + +```bash +kubectl delete -k . +``` diff --git a/examples/remotevlan/rvlanovs/kustomization.yaml b/examples/remotevlan/rvlanovs/kustomization.yaml new file mode 100644 index 000000000000..e267daca12a4 --- /dev/null +++ b/examples/remotevlan/rvlanovs/kustomization.yaml @@ -0,0 +1,16 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +namespace: nsm-system + +bases: + - ../../../apps/forwarder-ovs + +configMapGenerator: + - name: device-selector + files: + - selector + +patchesStrategicMerge: + - patch-forwarder-ovs.yaml diff --git a/examples/remotevlan/rvlanovs/patch-forwarder-ovs.yaml b/examples/remotevlan/rvlanovs/patch-forwarder-ovs.yaml new file mode 100644 index 000000000000..c24b80bc0b74 --- /dev/null +++ b/examples/remotevlan/rvlanovs/patch-forwarder-ovs.yaml @@ -0,0 +1,24 @@ +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: forwarder-ovs +spec: + template: + spec: + containers: + - name: forwarder-ovs + env: + - name: NSM_L2_RESOURCE_SELECTOR_FILE + value: /var/lib/networkservicemesh/device-selector.yaml + volumeMounts: + - name: devsel-vol + mountPath: /var/lib/networkservicemesh/device-selector.yaml + subPath: device-selector.yaml + volumes: + - name: devsel-vol + configMap: + name: device-selector + items: + - key: selector + path: device-selector.yaml diff --git a/examples/remotevlan/rvlanovs/selector b/examples/remotevlan/rvlanovs/selector new file mode 100644 index 000000000000..87e416520882 --- /dev/null +++ b/examples/remotevlan/rvlanovs/selector @@ -0,0 +1,7 @@ +--- +interfaces: + - name: eth1 + bridge: br0 + matches: + - labelSelector: + - via: gw1 diff --git a/examples/remotevlan/rvlanvpp/README.md b/examples/remotevlan/rvlanvpp/README.md index 54fae3d8f6df..098347186fea 100644 --- a/examples/remotevlan/rvlanvpp/README.md +++ b/examples/remotevlan/rvlanvpp/README.md @@ -8,7 +8,9 @@ Make sure that you have completed steps from [remotevlan](../../remotevlan) setu ## Includes -- [Kernel2RVlan](../../use-cases/Kernel2RVlan) +- [Kernel2RVlanInternal](../../use-cases/Kernel2RVlanInternal) +- [Kernel2RVlanBreakout](../../use-cases/Kernel2RVlanBreakout) +- [Kernel2RVlanMultiNS](../../use-cases/Kernel2RVlanMultiNS) ## Run @@ -17,3 +19,17 @@ Deploy the forwarder: ```bash kubectl apply -k . ``` + +Wait forwarder to start: + +```bash +kubectl -n nsm-system wait --for=condition=ready --timeout=2m pod -l app=forwarder-vpp +``` + +## Cleanup + +Delete the forwarder: + +```bash +kubectl delete -k . +``` diff --git a/examples/remotevlan/rvlanvpp/device-selector.yaml b/examples/remotevlan/rvlanvpp/device-selector.yaml deleted file mode 100644 index 3a31650c77f7..000000000000 --- a/examples/remotevlan/rvlanvpp/device-selector.yaml +++ /dev/null @@ -1,9 +0,0 @@ ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: device-selector - namespace: nsm-system -data: - selector: "---\ninterfaces:\n - name: eth1\n matches:\n - labelSelector:\n - \ - via: gw1\n \n" diff --git a/examples/remotevlan/rvlanvpp/kustomization.yaml b/examples/remotevlan/rvlanvpp/kustomization.yaml index 3e161cc8d9e6..869d15cd2c0c 100644 --- a/examples/remotevlan/rvlanvpp/kustomization.yaml +++ b/examples/remotevlan/rvlanvpp/kustomization.yaml @@ -7,8 +7,9 @@ namespace: nsm-system bases: - ../../../apps/forwarder-vpp -resources: - - device-selector.yaml - +configMapGenerator: + - name: device-selector + files: + - selector patchesStrategicMerge: - patch-forwarder-vpp.yaml diff --git a/examples/remotevlan/rvlanvpp/selector b/examples/remotevlan/rvlanvpp/selector new file mode 100644 index 000000000000..0d821322acaf --- /dev/null +++ b/examples/remotevlan/rvlanvpp/selector @@ -0,0 +1,6 @@ +--- +interfaces: + - name: eth1 + matches: + - labelSelector: + - via: gw1 diff --git a/examples/use-cases/Kernel2RVlan/.gitignore b/examples/use-cases/Kernel2RVlanBreakout/.gitignore similarity index 100% rename from examples/use-cases/Kernel2RVlan/.gitignore rename to examples/use-cases/Kernel2RVlanBreakout/.gitignore diff --git a/examples/use-cases/Kernel2RVlan/README.md b/examples/use-cases/Kernel2RVlanBreakout/README.md similarity index 60% rename from examples/use-cases/Kernel2RVlan/README.md rename to examples/use-cases/Kernel2RVlanBreakout/README.md index ab1ecfa12b38..a24b40ccc96e 100644 --- a/examples/use-cases/Kernel2RVlan/README.md +++ b/examples/use-cases/Kernel2RVlanBreakout/README.md @@ -17,7 +17,7 @@ NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicem NAMESPACE=${NAMESPACE:10} ``` -Create first iperf server deployment: +Create iperf server deployment: ```bash cat > first-iperf-s.yaml < kustomization.yaml < first-iperf-s.yaml < kustomization.yaml < first-iperf-s.yaml < second-iperf-s.yaml < Dockerfile <