From 1fbfad523fd9e95e9470181c76a5315ff291e4f9 Mon Sep 17 00:00:00 2001 From: lut777 Date: Mon, 12 Apr 2021 21:28:34 +0800 Subject: [PATCH] add single node e2e --- .github/workflows/build-x86-image.yaml | 49 +++++++++++++++++++++++++- Makefile | 41 +++++++++++++-------- yamls/kind.yaml.j2 | 2 ++ 3 files changed, 76 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-x86-image.yaml b/.github/workflows/build-x86-image.yaml index 444ffcc51ad..7cdebece73e 100644 --- a/.github/workflows/build-x86-image.yaml +++ b/.github/workflows/build-x86-image.yaml @@ -120,6 +120,53 @@ jobs: sudo chmod 666 /home/runner/.kube/config make e2e + single-node-e2e: + needs: build + name: 1-node-e2e + runs-on: ubuntu-18.04 + timeout-minutes: 30 + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Install Kind + env: + KIND_VERSION: v0.9.0 + run: | + curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64 + chmod +x ./kind + sudo mv kind /usr/local/bin + + - name: Init Kind + run: | + pip install j2cli --user + pip install "j2cli[yaml]" --user + sudo PATH=~/.local/bin:$PATH make kind-init-single + + - name: Download image + uses: actions/download-artifact@v2 + with: + name: image + + - name: Install Kube-OVN + run: | + docker load --input image.tar + sudo make kind-install-single + + - name: Set up Go 1.x + uses: actions/setup-go@v2 + with: + go-version: ^1.16 + id: go + + - name: Run E2E + run: | + go get -u github.com/onsi/ginkgo/ginkgo + go get -u github.com/onsi/gomega/... + sudo kubectl cluster-info + sudo chmod 666 /home/runner/.kube/config + make e2e + ha-e2e: needs: build name: 3-master-e2e @@ -206,7 +253,7 @@ jobs: sudo make kind-install-ipv6 push: - needs: [single-e2e, ha-e2e, ipv6-e2e] + needs: [single-e2e, single-node-e2e, ha-e2e, ipv6-e2e] name: push runs-on: ubuntu-18.04 steps: diff --git a/Makefile b/Makefile index f4e7b0924b4..c9a9f7436d5 100644 --- a/Makefile +++ b/Makefile @@ -63,7 +63,7 @@ build-bin: kind-init: kind delete cluster --name=kube-ovn - kube_proxy_mode=ipvs ip_family=ipv4 ha=false j2 yamls/kind.yaml.j2 -o yamls/kind.yaml + kube_proxy_mode=ipvs ip_family=ipv4 ha=false single=false j2 yamls/kind.yaml.j2 -o yamls/kind.yaml kind create cluster --config yamls/kind.yaml --name kube-ovn kubectl describe no docker exec kube-ovn-control-plane ip link add link eth0 mac1 type macvlan @@ -71,38 +71,33 @@ kind-init: kind-init-iptables: kind delete cluster --name=kube-ovn - kube_proxy_mode=iptables ip_family=ipv4 ha=false j2 yamls/kind.yaml.j2 -o yamls/kind.yaml + kube_proxy_mode=iptables ip_family=ipv4 ha=false single=false j2 yamls/kind.yaml.j2 -o yamls/kind.yaml kind create cluster --config yamls/kind.yaml --name kube-ovn kubectl describe no docker exec kube-ovn-control-plane ip link add link eth0 mac1 type macvlan docker exec kube-ovn-worker ip link add link eth0 mac1 type macvlan -kind-install: - kind load docker-image --name kube-ovn ${REGISTRY}/kube-ovn:${RELEASE_TAG} - kubectl taint node kube-ovn-control-plane node-role.kubernetes.io/master:NoSchedule- - ENABLE_SSL=true dist/images/install.sh +kind-init-ha: + kind delete cluster --name=kube-ovn + kube_proxy_mode=ipvs ip_family=ipv4 ha=true single=false j2 yamls/kind.yaml.j2 -o yamls/kind.yaml + kind create cluster --config yamls/kind.yaml --name kube-ovn kubectl describe no -kind-init-ha: +kind-init-single: kind delete cluster --name=kube-ovn - kube_proxy_mode=ipvs ip_family=ipv4 ha=true j2 yamls/kind.yaml.j2 -o yamls/kind.yaml + kube_proxy_mode=ipvs ip_family=ipv4 ha=false single=true j2 yamls/kind.yaml.j2 -o yamls/kind.yaml kind create cluster --config yamls/kind.yaml --name kube-ovn kubectl describe no kind-init-ipv6: kind delete cluster --name=kube-ovn - kube_proxy_mode=iptables ip_family=ipv6 ha=false j2 yamls/kind.yaml.j2 -o yamls/kind.yaml + kube_proxy_mode=iptables ip_family=ipv6 ha=false single=false j2 yamls/kind.yaml.j2 -o yamls/kind.yaml kind create cluster --config yamls/kind.yaml --name kube-ovn kubectl describe no -kind-install-ipv6: - kind load docker-image --name kube-ovn ${REGISTRY}/kube-ovn:${RELEASE_TAG} - kubectl taint node kube-ovn-control-plane node-role.kubernetes.io/master:NoSchedule- - ENABLE_SSL=true IPv6=true dist/images/install.sh - kind-init-dual: kind delete cluster --name=kube-ovn - kube_proxy_mode=iptables ip_family=DualStack ha=false j2 yamls/kind.yaml.j2 -o yamls/kind.yaml + kube_proxy_mode=iptables ip_family=DualStack ha=false single=false j2 yamls/kind.yaml.j2 -o yamls/kind.yaml kind create cluster --config yamls/kind.yaml --name kube-ovn kubectl describe no docker exec kube-ovn-control-plane ip link add link eth0 mac1 type macvlan @@ -110,6 +105,22 @@ kind-init-dual: docker exec kube-ovn-worker sysctl -w net.ipv6.conf.all.disable_ipv6=0 docker exec kube-ovn-control-plane sysctl -w net.ipv6.conf.all.disable_ipv6=0 +kind-install: + kind load docker-image --name kube-ovn ${REGISTRY}/kube-ovn:${RELEASE_TAG} + kubectl taint node kube-ovn-control-plane node-role.kubernetes.io/master:NoSchedule- + ENABLE_SSL=true dist/images/install.sh + kubectl describe no + +kind-install-single: + kind load docker-image --name kube-ovn ${REGISTRY}/kube-ovn:${RELEASE_TAG} + ENABLE_SSL=true dist/images/install.sh + kubectl describe no + +kind-install-ipv6: + kind load docker-image --name kube-ovn ${REGISTRY}/kube-ovn:${RELEASE_TAG} + kubectl taint node kube-ovn-control-plane node-role.kubernetes.io/master:NoSchedule- + ENABLE_SSL=true IPv6=true dist/images/install.sh + kind-install-dual: kind load docker-image --name kube-ovn ${REGISTRY}/kube-ovn:${RELEASE_TAG} kubectl taint node kube-ovn-control-plane node-role.kubernetes.io/master:NoSchedule- diff --git a/yamls/kind.yaml.j2 b/yamls/kind.yaml.j2 index 234e2d00ee5..8819409ca67 100644 --- a/yamls/kind.yaml.j2 +++ b/yamls/kind.yaml.j2 @@ -21,6 +21,8 @@ nodes: image: kindest/node:v1.19.1 - role: control-plane image: kindest/node:v1.19.1 + {%- elif single is equalto "true" %} + {%- else %} - role: worker image: kindest/node:v1.19.1