Skip to content

Commit

Permalink
vfio: register the service separately (#8100)
Browse files Browse the repository at this point in the history
* vfio: register the service separately

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Fix refs

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
  • Loading branch information
glazychev-art authored Dec 15, 2022
1 parent 1aeb8ce commit 50e4687
Show file tree
Hide file tree
Showing 17 changed files with 134 additions and 25 deletions.
2 changes: 1 addition & 1 deletion apps/nsc-vfio/nsc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
- name: vfio
mountPath: /dev/vfio

- name: sidecar
- name: nsc
image: ghcr.io/networkservicemesh/ci/cmd-nsc:41e0d21
imagePullPolicy: IfNotPresent
env:
Expand Down
4 changes: 2 additions & 2 deletions apps/nse-vfio/nse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
- name: vfio
mountPath: /dev/vfio

- name: sidecar
- name: nse
image: ghcr.io/networkservicemesh/ci/cmd-nse-vfio:f02a407
env:
- name: SPIFFE_ENDPOINT_SOCKET
Expand All @@ -42,7 +42,7 @@ spec:
fieldPath: metadata.name
- name: NSM_LOG_LEVEL
value: TRACE
- name: NSM_SERVICES
- name: NSM_SERVICE_NAMES
value: "pingpong@worker.domain: { addr: 0a:55:44:33:22:11 }"
volumeMounts:
- name: spire-agent-socket
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ kubectl create ns ns-kernel2ethernet2kernel-vfio2noop

Deploy NSCs and NSEs:
```bash
kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/use-cases/Kernel2Ethernet2Kernel_Vfio2Noop?ref=5b9b43c431f00c4caa99d09abf08f86622e8ac0a
kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/use-cases/Kernel2Ethernet2Kernel_Vfio2Noop?ref=817c71ca8b65f80e96fe9705596764601c6461e9
```

Wait for applications ready:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ kind: Kustomization

namespace: ns-kernel2ethernet2kernel-vfio2noop

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

resources:
- netsvc.yaml
- client.yaml
- ../../../apps/nse-kernel
- ../../../apps/nsc-vfio
- ../../../apps/nse-vfio
- netsvc.yaml
- client.yaml

patchesStrategicMerge:
- patch-nse.yaml
- patch-nse.yaml
- patch-nsc-vfio.yaml
- patch-nse-vfio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@ metadata:
namespace: nsm-system
spec:
payload: ETHERNET

---
apiVersion: networkservicemesh.io/v1
kind: NetworkService
metadata:
name: vfio2noop
namespace: nsm-system
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nsc-vfio
spec:
template:
spec:
containers:
- name: nsc
env:
- name: NSM_NETWORK_SERVICES
value: vfio://vfio2noop?sriovToken=worker.domain/10G
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nse-vfio
spec:
template:
spec:
containers:
- name: nse
env:
- name: NSM_SERVICE_NAMES
value: "vfio2noop@worker.domain: { addr: 0a:55:44:33:22:11 }"
- name: NSM_REGISTER_SERVICE
value: "false"
2 changes: 1 addition & 1 deletion examples/use-cases/Kernel2Kernel_Vfio2Noop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ kubectl create ns ns-kernel2kernel-vfio2noop

Deploy NSCs and NSEs:
```bash
kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/use-cases/Kernel2Kernel_Vfio2Noop?ref=5b9b43c431f00c4caa99d09abf08f86622e8ac0a
kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/use-cases/Kernel2Kernel_Vfio2Noop?ref=817c71ca8b65f80e96fe9705596764601c6461e9
```

Wait for applications ready:
Expand Down
16 changes: 8 additions & 8 deletions examples/use-cases/Kernel2Kernel_Vfio2Noop/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ kind: Kustomization

namespace: ns-kernel2kernel-vfio2noop

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

resources:
- netsvc.yaml
- client.yaml
- ../../../apps/nse-kernel
- ../../../apps/nsc-vfio
- ../../../apps/nse-vfio
- netsvc.yaml
- client.yaml

patchesStrategicMerge:
- patch-nse.yaml
- patch-nse.yaml
- patch-nsc-vfio.yaml
- patch-nse-vfio.yaml
7 changes: 7 additions & 0 deletions examples/use-cases/Kernel2Kernel_Vfio2Noop/netsvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@ metadata:
namespace: nsm-system
spec:
payload: ETHERNET

---
apiVersion: networkservicemesh.io/v1
kind: NetworkService
metadata:
name: vfio2noop
namespace: nsm-system
13 changes: 13 additions & 0 deletions examples/use-cases/Kernel2Kernel_Vfio2Noop/patch-nsc-vfio.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nsc-vfio
spec:
template:
spec:
containers:
- name: nsc
env:
- name: NSM_NETWORK_SERVICES
value: vfio://vfio2noop?sriovToken=worker.domain/10G
15 changes: 15 additions & 0 deletions examples/use-cases/Kernel2Kernel_Vfio2Noop/patch-nse-vfio.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nse-vfio
spec:
template:
spec:
containers:
- name: nse
env:
- name: NSM_SERVICE_NAMES
value: "vfio2noop@worker.domain: { addr: 0a:55:44:33:22:11 }"
- name: NSM_REGISTER_SERVICE
value: "false"
2 changes: 1 addition & 1 deletion examples/use-cases/Vfio2Noop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ kubectl create ns ns-vfio2noop

Deploy NSC and NSE:
```bash
kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/use-cases/Vfio2Noop?ref=5b9b43c431f00c4caa99d09abf08f86622e8ac0a
kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/use-cases/Vfio2Noop?ref=817c71ca8b65f80e96fe9705596764601c6461e9
```

Wait for applications ready:
Expand Down
11 changes: 8 additions & 3 deletions examples/use-cases/Vfio2Noop/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ kind: Kustomization

namespace: ns-vfio2noop

bases:
- ../../../apps/nsc-vfio
- ../../../apps/nse-vfio
resources:
- ../../../apps/nsc-vfio
- ../../../apps/nse-vfio
- netsvc.yaml

patchesStrategicMerge:
- patch-nsc-vfio.yaml
- patch-nse-vfio.yaml
6 changes: 6 additions & 0 deletions examples/use-cases/Vfio2Noop/netsvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
apiVersion: networkservicemesh.io/v1
kind: NetworkService
metadata:
name: vfio2noop
namespace: nsm-system
13 changes: 13 additions & 0 deletions examples/use-cases/Vfio2Noop/patch-nsc-vfio.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nsc-vfio
spec:
template:
spec:
containers:
- name: nsc
env:
- name: NSM_NETWORK_SERVICES
value: vfio://vfio2noop?sriovToken=worker.domain/10G
15 changes: 15 additions & 0 deletions examples/use-cases/Vfio2Noop/patch-nse-vfio.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nse-vfio
spec:
template:
spec:
containers:
- name: nse
env:
- name: NSM_SERVICE_NAMES
value: "vfio2noop@worker.domain: { addr: 0a:55:44:33:22:11 }"
- name: NSM_REGISTER_SERVICE
value: "false"

0 comments on commit 50e4687

Please sign in to comment.