This repository was archived by the owner on Apr 8, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathvpp_host.sh
executable file
·70 lines (64 loc) · 1.6 KB
/
vpp_host.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
# Set USERSPACEDIR if not defined in parent script
USERSPACEDIR="${USERSPACEDIR:=/runner/_work/userspace-cni-network-plugin/userspace-cni-network-plugin/}"
kubectl delete ns vpp
kubectl create ns vpp
kubectl create -n vpp configmap vpp-startup-config --from-file="${USERSPACEDIR}/examples/sample-vpp-host-config/startup.conf"
worker="kind-control-plane"
docker exec -i kind-control-plane bash -c "mkdir -p /var/run/vpp/app"
cat << EOF | kubectl apply -f -
---
apiVersion: v1
kind: Pod
metadata:
name: vpp-$worker
labels:
name: vpp
namespace: vpp
spec:
nodeSelector:
kubernetes.io/hostname: $worker
hostname: vpp-$worker
subdomain: vpp
containers:
- image: ligato/vpp-base:23.02 #imagename
imagePullPolicy: IfNotPresent
name: vpp-$worker
volumeMounts:
- name: vpp-api
mountPath: /run/vpp/
- name: vpp-run
mountPath: /var/run/vpp/
- name: vpp-startup-config
mountPath: /etc/vpp/
- name: hugepage
mountPath: /hugepages
- name: userspace-api
mountPath: /var/lib/cni/usrspcni/
resources:
requests:
hugepages-2Mi: 1Gi
memory: "1Gi"
cpu: "3"
limits:
hugepages-2Mi: 1Gi
memory: "1Gi"
cpu: "3"
restartPolicy: Always
volumes:
- name: vpp-run
hostPath:
path: /var/run/vpp/
- name: vpp-api
hostPath:
path: /run/vpp/
- name: userspace-api
hostPath:
path: /var/lib/cni/usrspcni/
- name: vpp-startup-config
configMap:
name: vpp-startup-config
- name: hugepage
emptyDir:
medium: HugePages
EOF