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

Feature/calico integration #4143

Merged
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
58 changes: 58 additions & 0 deletions examples/calico/README.md
Original file line number Diff line number Diff line change
@@ -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
```
24 changes: 24 additions & 0 deletions examples/calico/calico-patch.yaml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions examples/calico/calico-vpp-dataplane/calico-vpp-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: calico-vpp-config
namespace: calico-vpp-dataplane
data:
vpp_dataplane_interface: eno2
9 changes: 9 additions & 0 deletions examples/calico/calico-vpp-dataplane/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions examples/calico/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

bases:
- ../basic

patchesStrategicMerge:
- calico-patch.yaml