-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add ovs remote vlan markdown example
Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>
- Loading branch information
1 parent
5498b21
commit 8ac8865
Showing
4 changed files
with
145 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: device-selector | ||
namespace: nsm-system | ||
data: | ||
selector: "---\nbridges:\n - name: br-snic0\n matches:\n - labelSelector:\n - via: gw0\n \n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
namespace: nsm-system | ||
|
||
bases: | ||
- ../../apps/nsmgr | ||
- ../../apps/registry-k8s | ||
- ../../apps/forwarder-host-ovs | ||
- ./device-selector.yaml | ||
- ../../apps/nse-remote-vlan-vpp | ||
|
||
patchesStrategicMerge: | ||
- forwarder-ovs.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# Test Smart VF connections with VLAN Breakout | ||
|
||
This example shows that NSCs are connected over single broadcasting domain with VLAN physical network, | ||
The VLAN selection is done by a network service on which NS client connect to. | ||
|
||
## Requires | ||
|
||
Make sure that you have completed steps from [ovs remote vlan](../../ovsremotevlan) setup. | ||
|
||
## Run | ||
|
||
Create test namespace: | ||
```bash | ||
NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a852347fbfd1c3c6b845580c16933872350a8530/examples/use-cases/namespace.yaml)[0]) | ||
NAMESPACE=${NAMESPACE:10} | ||
``` | ||
|
||
Create customization file: | ||
```bash | ||
cat > kustomization.yaml <<EOF | ||
--- | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
namespace: ${NAMESPACE} | ||
bases: | ||
- ../../../apps/nsc-kernel | ||
patchesStrategicMerge: | ||
- patch-nsc.yaml | ||
EOF | ||
``` | ||
|
||
Create NSC patch: | ||
```bash | ||
cat > patch-nsc.yaml <<EOF | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nsc-kernel | ||
spec: | ||
replicas: 3 | ||
template: | ||
spec: | ||
affinity: | ||
podAntiAffinity: | ||
preferredDuringSchedulingIgnoredDuringExecution: | ||
- weight: 100 | ||
podAffinityTerm: | ||
labelSelector: | ||
matchExpressions: | ||
- key: app | ||
operator: In | ||
values: | ||
- nsc-kernel | ||
topologyKey: kubernetes.io/hostname | ||
containers: | ||
- name: nsc | ||
env: | ||
- name: NSM_NETWORK_SERVICES | ||
value: kernel://finance-bridge/nsm-1?sriovToken=worker.domain/100G | ||
resources: | ||
limits: | ||
worker.domain/100G: 1 | ||
EOF | ||
``` | ||
|
||
Deploy NSC: | ||
```bash | ||
kubectl apply -k . | ||
``` | ||
|
||
Wait for NSC pods are ready: | ||
```bash | ||
kubectl -n ${NAMESPACE} wait --for=condition=ready --timeout=1m pod -l app=nsc-kernel | ||
``` | ||
|
||
Get NSC pods: | ||
```bash | ||
NSC1=$((kubectl get pods -l app=nsc-kernel -n ${NAMESPACE} --template '{{range .items}}{{.metadata.name}}{{" "}}{{end}}') | cut -d' ' -f1) | ||
TARGET_IP=$(kubectl exec -ti ${NSC1} -n ${NAMESPACE} -- ip route show | grep 172.10 | cut -d' ' -f1) | ||
NSC2=$((kubectl get pods -l app=nsc-kernel -n ${NAMESPACE} --template '{{range .items}}{{.metadata.name}}{{" "}}{{end}}') | cut -d' ' -f2) | ||
``` | ||
Ping from NSC2 to NSC1: | ||
```bash | ||
kubectl -n ${NAMESPACE} exec ${NSC2} -- ping -c 4 ${TARGET_IP} | ||
``` | ||
## Cleanup | ||
Delete ns: | ||
```bash | ||
kubectl delete ns ${NAMESPACE} | ||
``` |