Merge pull request #8837 from Rory-Z/main-v4.4

chore: use minikube instead k3s
This commit is contained in:
zhouzb 2022-08-30 21:27:12 +08:00 committed by GitHub
commit 16d32b9f57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 33 deletions

View File

@ -96,17 +96,8 @@ jobs:
fi fi
- name: make emqx image - name: make emqx image
run: make ${PROFILE}-docker run: make ${PROFILE}-docker
- name: install k3s - run: minikube start
env:
KUBECONFIG: "/etc/rancher/k3s/k3s.yaml"
run: |
sudo sh -c "echo \"127.0.0.1 $(hostname)\" >> /etc/hosts"
curl -sfL https://get.k3s.io | sh -
sudo chmod 644 /etc/rancher/k3s/k3s.yaml
kubectl cluster-info
- name: install helm - name: install helm
env:
KUBECONFIG: "/etc/rancher/k3s/k3s.yaml"
run: | run: |
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
sudo chmod 700 get_helm.sh sudo chmod 700 get_helm.sh
@ -114,15 +105,12 @@ jobs:
helm version helm version
- name: setup emqx chart - name: setup emqx chart
run: | run: |
sudo docker save ${TARGET}:${EMQX_TAG} -o emqx.tar.gz minikube image load ${TARGET}:${EMQX_TAG}
sudo k3s ctr image import emqx.tar.gz
sed -i -r "s/^appVersion: .*$/appVersion: \"${EMQX_TAG}\"/g" deploy/charts/emqx/Chart.yaml sed -i -r "s/^appVersion: .*$/appVersion: \"${EMQX_TAG}\"/g" deploy/charts/emqx/Chart.yaml
sed -i '/emqx_telemetry/d' deploy/charts/emqx/values.yaml sed -i '/emqx_telemetry/d' deploy/charts/emqx/values.yaml
- name: run emqx on chart - name: run emqx on chart
if: matrix.discovery == 'k8s' if: matrix.discovery == 'k8s'
env:
KUBECONFIG: "/etc/rancher/k3s/k3s.yaml"
run: | run: |
helm install emqx \ helm install emqx \
--set image.repository=${TARGET} \ --set image.repository=${TARGET} \
@ -135,8 +123,6 @@ jobs:
--debug --debug
- name: run emqx on chart - name: run emqx on chart
if: matrix.discovery == 'dns' if: matrix.discovery == 'dns'
env:
KUBECONFIG: "/etc/rancher/k3s/k3s.yaml"
run: | run: |
helm install emqx \ helm install emqx \
--set emqxConfig.EMQX_CLUSTER__DISCOVERY="dns" \ --set emqxConfig.EMQX_CLUSTER__DISCOVERY="dns" \
@ -152,8 +138,6 @@ jobs:
deploy/charts/emqx \ deploy/charts/emqx \
--debug --debug
- name: waiting emqx started - name: waiting emqx started
env:
KUBECONFIG: "/etc/rancher/k3s/k3s.yaml"
timeout-minutes: 5 timeout-minutes: 5
run: | run: |
while [ "$(kubectl get StatefulSet -l app.kubernetes.io/name=emqx -o jsonpath='{.items[0].status.replicas}')" \ while [ "$(kubectl get StatefulSet -l app.kubernetes.io/name=emqx -o jsonpath='{.items[0].status.replicas}')" \
@ -165,8 +149,6 @@ jobs:
sleep 10; sleep 10;
done done
- name: Check ${{ matrix.kind[0]}} cluster - name: Check ${{ matrix.kind[0]}} cluster
env:
KUBECONFIG: "/etc/rancher/k3s/k3s.yaml"
timeout-minutes: 10 timeout-minutes: 10
run: | run: |
while while
@ -178,22 +160,16 @@ jobs:
done done
- name: get emqx-0 pods log - name: get emqx-0 pods log
if: failure() if: failure()
env:
KUBECONFIG: "/etc/rancher/k3s/k3s.yaml"
run: | run: |
kubectl describe pods emqx-0 kubectl describe pods emqx-0
kubectl logs emqx-0 kubectl logs emqx-0
- name: get emqx-1 pods log - name: get emqx-1 pods log
if: failure() if: failure()
env:
KUBECONFIG: "/etc/rancher/k3s/k3s.yaml"
run: | run: |
kubectl describe pods emqx-1 kubectl describe pods emqx-1
kubectl logs emqx-1 kubectl logs emqx-1
- name: get emqx-2 pods log - name: get emqx-2 pods log
if: failure() if: failure()
env:
KUBECONFIG: "/etc/rancher/k3s/k3s.yaml"
run: | run: |
kubectl describe pods emqx-2 kubectl describe pods emqx-2
kubectl logs emqx-2 kubectl logs emqx-2
@ -207,16 +183,12 @@ jobs:
pip install pytest pip install pytest
echo "$HOME/.local/bin" >> $GITHUB_PATH echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: run paho test - name: run paho test
env:
KUBECONFIG: "/etc/rancher/k3s/k3s.yaml"
run: | run: |
emqx_svc=$(kubectl get svc --namespace default emqx -o jsonpath="{.spec.clusterIP}") nohup kubectl port-forward svc/emqx 1883:1883 &
emqx1=$(kubectl get pods emqx-1 -o jsonpath='{.status.podIP}')
emqx2=$(kubectl get pods emqx-2 -o jsonpath='{.status.podIP}')
pytest -v paho.mqtt.testing/interoperability/test_client/V5/test_connect.py -k test_basic --host $emqx_svc pytest -v paho.mqtt.testing/interoperability/test_client/V5/test_connect.py -k test_basic
RESULT=$? RESULT=$?
pytest -v paho.mqtt.testing/interoperability/test_cluster --host1 $emqx1 --host2 $emqx2 pytest -v paho.mqtt.testing/interoperability/test_cluster
RESULT=$((RESULT + $?)) RESULT=$((RESULT + $?))
if [ 0 -ne $RESULT ]; then if [ 0 -ne $RESULT ]; then
kubectl logs emqx-1 kubectl logs emqx-1