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

Add crio e2e #23

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
48 changes: 48 additions & 0 deletions .github/workflows/e2e-crio.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: e2e tests - crio

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v2
with:
python-version: 3.x

- run: |
pip3 install --user --upgrade j2cli
j2 --version
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18

- name: Start minikube
uses: medyagh/setup-minikube@master
with:
minikube-version: 1.26.1
container-runtime: cri-o
kubernetes-version: v1.24.3
cni: bridge

- name: Deploy multus & the PRs contents
run: hack/e2e-crio-cluster-setup.sh

- name: Test - provisioning the examples
run: e2e/test-provisioning-examples.sh

- name: Test - execute golang based e2e tests
env:
KUBECONFIG: /home/runner/.kube/config
run: make e2e/test

- name: Cleanup cluster
run: |
minikube delete
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
bin/
multus-cni/
kubevirtci/
43 changes: 43 additions & 0 deletions hack/e2e-crio-cluster-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash
set -xe

CNI_VERSION=${CNI_VERSION:-0.4.0}
OCI_BIN=${OCI_BIN:-docker}

K8S_VERSION=${K8S_VERSION:-1.24}

IMAGE_REPO=${IMG_REPO:-maiqueb}
IMAGE_NAME="multus-dynamic-networks-controller"
IMAGE_TAG="latest"

push_local_image() {
OCI_BIN="$OCI_BIN" IMAGE_REGISTRY="registry:5000/$IMAGE_REPO" make manifests
OCI_BIN="$OCI_BIN" IMAGE_REGISTRY="$IMG_REGISTRY" make img-build
"$OCI_BIN" push --tls-verify=false "$IMG_REGISTRY/$IMAGE_NAME:$IMAGE_TAG"
}

setup_registry() {
# https://minikube.sigs.k8s.io/docs/handbook/registry/
minikube addons enable registry
"$OCI_BIN" run --rm -it --network=host alpine ash -c "apk add socat && socat TCP-LISTEN:5000,reuseaddr,fork TCP:$(minikube ip):5000"
}

cleanup() {
git checkout -- manifests/
echo "=============="
echo " minikube logs:"
echo "=============="
minikube logs
}

trap "cleanup" EXIT

setup_registry

IMG_REGISTRY="localhost:5000/$IMAGE_REPO" push_local_image

kubectl apply -f https://raw.githubusercontent.com/k8snetworkplumbingwg/multus-cni/master/deployments/multus-daemonset-thick.yml
kubectl wait -nkube-system --for=condition=ready --timeout=180s -l app=multus pods

kubectl apply -f manifests/dynamic-networks-controller.yaml
kubectl wait -nkube-system --for=condition=ready --timeout=180s -l app=dynamic-networks-controller pods