Skip to content

Commit

Permalink
ci to test make some commands
Browse files Browse the repository at this point in the history
Signed-off-by: John O'Loughlin <[email protected]>
  • Loading branch information
johnoloughlin committed Jan 5, 2024
1 parent b8e6ed2 commit 1c606ac
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 29 deletions.
9 changes: 7 additions & 2 deletions ci/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ kubectl get all --all-namespaces
sleep 10
cd $USERSPACEDIR

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

vpp_e2e_test(){
cd $USERSPACEDIR
kubectl label nodes kind-control-plane app=userspacecni
make deploy
kubectl get nodes
kubectl get nodes --show-labels
cd $CI_DIR/vpp_test_setup/
echo "Setting up vpp host"
./vpp_host.sh
Expand Down
48 changes: 24 additions & 24 deletions ci/vpp_test_setup/vpp_host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,32 @@ kubectl create -n vpp configmap vpp-startup-config --from-file="${USERSPACEDIR}/
worker="kind-control-plane"


rm /opt/cni/bin/userspace
#rm /opt/cni/bin/userspace
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: userspacecni-$worker
namespace: vpp
spec:
nodeSelector:
kubernetes.io/hostname: $worker
containers:
- name: userspacecni-$worker
image: userspacecni:latest
imagePullPolicy: IfNotPresent
volumeMounts:
- name: cni
mountPath: /opt/cni/bin
volumes:
- name: cni
hostPath:
path: /opt/cni/bin
restartPolicy: Never
EOF
# cat << EOF | kubectl apply -f -
# ---
# apiVersion: v1
# kind: Pod
# metadata:
# name: userspacecni-$worker
# namespace: vpp
# spec:
# nodeSelector:
# kubernetes.io/hostname: $worker
# containers:
# - name: userspacecni-$worker
# image: userspacecni:latest
# imagePullPolicy: IfNotPresent
# volumeMounts:
# - name: cni
# mountPath: /opt/cni/bin
# volumes:
# - name: cni
# hostPath:
# path: /opt/cni/bin
# restartPolicy: Never
# EOF


echo "sleeping for 20 to allow userspace to deploy first"
Expand Down
21 changes: 18 additions & 3 deletions kubernetes/userspace-daemonset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,36 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: userspace-cni
name: userspacecni
namespace: kube-system
spec:
selector:
matchLabels:
app: userspace-cni
app: userspacecni
template:
metadata:
labels:
app: userspace-cni
app: userspacecni
spec:
containers:
- name: userspace-cni-plugin
image: localhost:5000/userspacecni #registory:imagename
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: [ "ALL" ]
runAsNonRoot: true
runAsUser: 10000
seccompProfile:
type: RuntimeDefault
resources:
requests:
cpu: 1m
memory: 1Mi
limits:
cpu: 100m
memory: 30Mi
volumeMounts:
- name: cnibin
mountPath: /opt/cni/bin
Expand Down

0 comments on commit 1c606ac

Please sign in to comment.