Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Use forwarder-vpp in basic/memory examples #80

Merged
merged 4 commits into from
Jan 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- sriov-forwarder.yaml
- forwarder-sriov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: sriov-forwarder
name: forwarder-sriov
labels:
app: sriov-forwarder
app: forwarder-sriov
spec:
selector:
matchLabels:
app: sriov-forwarder
app: forwarder-sriov
template:
metadata:
labels:
app: sriov-forwarder
app: forwarder-sriov
spec:
hostNetwork: true
containers:
- image: networkservicemeshci/cmd-forwarder-sriov:5caf3253
imagePullPolicy: IfNotPresent
name: sriov-forwarder
name: forwarder-sriov
securityContext:
privileged: true
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,34 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: fake-cross-nse
name: forwarder-vpp
labels:
app: fake-cross-nse
app: forwarder-vpp
spec:
selector:
matchLabels:
app: fake-cross-nse
app: forwarder-vpp
template:
metadata:
labels:
app: fake-cross-nse
app: forwarder-vpp
spec:
containers:
- image: networkservicemeshci/fake-cross-nse:latest
- image: networkservicemeshci/cmd-forwarder-vpp:46aab74c
imagePullPolicy: IfNotPresent
name: fake-cross-nse
name: forwarder-vpp
securityContext:
privileged: true
env:
- name: SPIFFE_ENDPOINT_SOCKET
value: unix:///run/spire/sockets/agent.sock
- name: FAKE-CROSS-NSE_NAME
- name: NSM_TUNNEL_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: NSM_CONNECT_TO
value: unix:///var/lib/networkservicemesh/nsm.io.sock
- name: NSM_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 0 additions & 5 deletions examples/RemoteConnection/namespace.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions examples/SRIOVKernelConnection/namespace.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions examples/VFIOConnection/namespace.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions examples/basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Basis example contains setup and tear down logic with default NSM infrastructure

## Includes

- [Local Connection](../LocalConnection)
- [Remote Connection](../RemoteConnection)
- [Local Connection](../use-cases/LocalConnection)
- [Remote Connection](../use-cases/RemoteConnection)

## Run

Expand Down
2 changes: 1 addition & 1 deletion examples/basic/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ namespace: nsm-system

bases:
- ../../apps/nsmgr
- ../../apps/fake-forwarder
- ../../apps/forwarder-vpp
- ../../apps/registry-k8s
4 changes: 2 additions & 2 deletions examples/memory/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Memory example contains setup and tear down logic with default NSM infrastructur

## Includes

- [Local Connection](../LocalConnection)
- [Remote Connection](../RemoteConnection)
- [Local Connection](../use-cases/LocalConnection)
- [Remote Connection](../use-cases/RemoteConnection)

## Run

Expand Down
2 changes: 1 addition & 1 deletion examples/memory/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ namespace: nsm-system

bases:
- ../../apps/nsmgr
- ../../apps/fake-forwarder
- ../../apps/forwarder-vpp
- ../../apps/registry-memory
4 changes: 2 additions & 2 deletions examples/sriov/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

## Includes

- [VFIO Connection](../VFIOConnection)
- [Kernel Connection](../SRIOVKernelConnection)
- [VFIO Connection](../use-cases/VFIOConnection)
- [Kernel Connection](../use-cases/SRIOVKernelConnection)

## Run

Expand Down
2 changes: 1 addition & 1 deletion examples/sriov/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ namespace: nsm-system

bases:
- ../../apps/nsmgr
- ../../apps/sriov-forwarder
- ../../apps/forwarder-sriov
- ../../apps/registry-memory
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This example shows that NSC and NSE on the one node can find each other.

Create test namespace:
```bash
NAMESPACE=($(kubectl create -f namespace.yaml)[0])
NAMESPACE=($(kubectl create -f ../namespace.yaml)[0])
NAMESPACE=${NAMESPACE:10}
```

Expand Down Expand Up @@ -36,8 +36,8 @@ kind: Kustomization
namespace: ${NAMESPACE}

bases:
- ../../apps/kernel-nsc
- ../../apps/kernel-nse
- ../../../apps/nsc-kernel
- ../../../apps/nse-kernel

patchesStrategicMerge:
- patch-nsc.yaml
Expand Down Expand Up @@ -77,6 +77,13 @@ metadata:
spec:
template:
spec:
containers:
- name: nse
env:
- name: NSE_CIDR_PREFIX
value: 172.16.1.100/31
- name: NSM_NETWORK_SERVICES
value: kernel://icmp-responder/nsm-1
nodeSelector:
kubernetes.io/hostname: ${NODE}
EOF
Expand All @@ -95,9 +102,23 @@ kubectl wait --for=condition=ready --timeout=1m pod -l app=nsc -n ${NAMESPACE}
kubectl wait --for=condition=ready --timeout=1m pod -l app=nse -n ${NAMESPACE}
```

Check connection result:
Find nsc and nse pods by labesl:
```bash
NSC=$(kubectl get pods -l app=nsc -n ${NAMESPACE} --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
```

```bash
NSE=$(kubectl get pods -l app=nse -n ${NAMESPACE} --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
```

Ping from nsc to nse:
```bash
kubectl exec ${NSC} -n ${NAMESPACE} -- ping -c 4 172.16.1.100
```

Ping from nse to nsc:
```bash
kubectl logs -l app=nsc -n ${NAMESPACE} | grep "All client init operations are done."
kubectl exec ${NSE} -n ${NAMESPACE} -- ping -c 4 172.16.1.101
```

## Cleanup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This example shows that NSC and NSE on the different nodes could find and work w

Create test namespace:
```bash
NAMESPACE=($(kubectl create -f namespace.yaml)[0])
NAMESPACE=($(kubectl create -f ../namespace.yaml)[0])
NAMESPACE=${NAMESPACE:10}
```

Expand Down Expand Up @@ -35,8 +35,8 @@ kind: Kustomization
namespace: ${NAMESPACE}

bases:
- ../../apps/kernel-nsc
- ../../apps/kernel-nse
- ../../../apps/nsc-kernel
- ../../../apps/nse-kernel

patchesStrategicMerge:
- patch-nsc.yaml
Expand All @@ -60,6 +60,7 @@ spec:
env:
- name: NSM_NETWORK_SERVICES
value: kernel://icmp-responder/nsm-1

nodeSelector:
kubernetes.io/hostname: ${NODES[0]}
EOF
Expand All @@ -76,6 +77,13 @@ metadata:
spec:
template:
spec:
containers:
- name: nse
env:
- name: NSE_CIDR_PREFIX
value: 172.16.1.100/31
- name: NSM_NETWORK_SERVICES
value: kernel://icmp-responder/nsm-1
nodeSelector:
kubernetes.io/hostname: ${NODES[1]}
EOF
Expand All @@ -99,6 +107,25 @@ Check connection result:
kubectl logs -l app=nsc -n ${NAMESPACE} | grep "All client init operations are done."
```

Find nsc and nse pods by labels:
```bash
NSC=$(kubectl get pods -l app=nsc -n ${NAMESPACE} --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
```

```bash
NSE=$(kubectl get pods -l app=nse -n ${NAMESPACE} --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
```

Ping from nsc to nse:
```bash
kubectl exec ${NSC} -n ${NAMESPACE} -- ping -c 4 172.16.1.100
```

Ping from nse to nsc:
```bash
kubectl exec ${NSE} -n ${NAMESPACE} -- ping -c 4 172.16.1.101
```

## Cleanup

Delete ns:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ kind: Kustomization
namespace: ${NAMESPACE}

bases:
- ../../apps/kernel-nsc
- ../../apps/kernel-nse
- ../../apps/kernel-ponger
- ../../../apps/nsc-kernel
- ../../../apps/nse-kernel
- ../../../apps/nsc-kernel-ponger


patchesStrategicMerge:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This example shows that NSC and NSE can work with each other over the VFIO conne

Create test namespace:
```bash
NAMESPACE=($(kubectl create -f namespace.yaml)[0])
NAMESPACE=($(kubectl create -f ../namespace.yaml)[0])
NAMESPACE=${NAMESPACE:10}
```

Expand All @@ -30,8 +30,8 @@ kind: Kustomization
namespace: ${NAMESPACE}

bases:
- ../../apps/vfio-nsc
- ../../apps/vfio-nse
- ../../../apps/vfio-nsc
- ../../../apps/nse-vfio
EOF
```

Expand Down