Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

Commit 1c606ac

Browse files
committed
ci to test make some commands
Signed-off-by: John O'Loughlin <[email protected]>
1 parent b8e6ed2 commit 1c606ac

File tree

3 files changed

+49
-29
lines changed

3 files changed

+49
-29
lines changed

Diff for: ci/ci.sh

+7-2
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ kubectl get all --all-namespaces
4545
sleep 10
4646
cd $USERSPACEDIR
4747

48-
docker build . -f ./docker/userspacecni/Dockerfile -t userspacecni:latest
48+
make build
4949
# gets path for one directopry above, needed for mkdir with docker cp below
5050
mkdir_var=$(dirname ${USERSPACEDIR})
51-
kind load docker-image userspacecni
51+
kind load docker-image localhost:5000/userspacecni
5252
docker exec -i kind-control-plane bash -c "mkdir -p $mkdir_var"
5353
docker cp "${USERSPACEDIR}" "kind-control-plane:${USERSPACEDIR}"
5454
}
@@ -63,6 +63,11 @@ kubectl apply -f ./multus-daemonset.yml
6363
}
6464

6565
vpp_e2e_test(){
66+
cd $USERSPACEDIR
67+
kubectl label nodes kind-control-plane app=userspacecni
68+
make deploy
69+
kubectl get nodes
70+
kubectl get nodes --show-labels
6671
cd $CI_DIR/vpp_test_setup/
6772
echo "Setting up vpp host"
6873
./vpp_host.sh

Diff for: ci/vpp_test_setup/vpp_host.sh

+24-24
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,32 @@ kubectl create -n vpp configmap vpp-startup-config --from-file="${USERSPACEDIR}/
1010
worker="kind-control-plane"
1111

1212

13-
rm /opt/cni/bin/userspace
13+
#rm /opt/cni/bin/userspace
1414
docker exec -i kind-control-plane bash -c "mkdir -p /var/run/vpp/app"
1515

16-
cat << EOF | kubectl apply -f -
17-
---
18-
apiVersion: v1
19-
kind: Pod
20-
metadata:
21-
name: userspacecni-$worker
22-
namespace: vpp
23-
spec:
24-
nodeSelector:
25-
kubernetes.io/hostname: $worker
26-
containers:
27-
- name: userspacecni-$worker
28-
image: userspacecni:latest
29-
imagePullPolicy: IfNotPresent
30-
volumeMounts:
31-
- name: cni
32-
mountPath: /opt/cni/bin
33-
volumes:
34-
- name: cni
35-
hostPath:
36-
path: /opt/cni/bin
37-
restartPolicy: Never
38-
EOF
16+
# cat << EOF | kubectl apply -f -
17+
# ---
18+
# apiVersion: v1
19+
# kind: Pod
20+
# metadata:
21+
# name: userspacecni-$worker
22+
# namespace: vpp
23+
# spec:
24+
# nodeSelector:
25+
# kubernetes.io/hostname: $worker
26+
# containers:
27+
# - name: userspacecni-$worker
28+
# image: userspacecni:latest
29+
# imagePullPolicy: IfNotPresent
30+
# volumeMounts:
31+
# - name: cni
32+
# mountPath: /opt/cni/bin
33+
# volumes:
34+
# - name: cni
35+
# hostPath:
36+
# path: /opt/cni/bin
37+
# restartPolicy: Never
38+
# EOF
3939

4040

4141
echo "sleeping for 20 to allow userspace to deploy first"

Diff for: kubernetes/userspace-daemonset.yml

+18-3
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,36 @@
22
apiVersion: apps/v1
33
kind: DaemonSet
44
metadata:
5-
name: userspace-cni
5+
name: userspacecni
66
namespace: kube-system
77
spec:
88
selector:
99
matchLabels:
10-
app: userspace-cni
10+
app: userspacecni
1111
template:
1212
metadata:
1313
labels:
14-
app: userspace-cni
14+
app: userspacecni
1515
spec:
1616
containers:
1717
- name: userspace-cni-plugin
1818
image: localhost:5000/userspacecni #registory:imagename
1919
imagePullPolicy: IfNotPresent
20+
securityContext:
21+
allowPrivilegeEscalation: false
22+
capabilities:
23+
drop: [ "ALL" ]
24+
runAsNonRoot: true
25+
runAsUser: 10000
26+
seccompProfile:
27+
type: RuntimeDefault
28+
resources:
29+
requests:
30+
cpu: 1m
31+
memory: 1Mi
32+
limits:
33+
cpu: 100m
34+
memory: 30Mi
2035
volumeMounts:
2136
- name: cnibin
2237
mountPath: /opt/cni/bin

0 commit comments

Comments
 (0)