diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1ffe9a2cb..a7abcb244 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -69,7 +69,7 @@ jobs: - uses: emqx/push-helm-action@v1 if: github.event_name == 'release' && startsWith(github.ref_name, 'e') with: - charts_dir: "${{ github.workspace }}/deploy/charts/emqx-ee" + charts_dir: "${{ github.workspace }}/deploy/charts/emqx-enterprise" version: ${{ github.ref_name }} aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} diff --git a/.github/workflows/run_fvt_tests.yaml b/.github/workflows/run_fvt_tests.yaml index b22254c8a..fbd18f1ce 100644 --- a/.github/workflows/run_fvt_tests.yaml +++ b/.github/workflows/run_fvt_tests.yaml @@ -153,16 +153,10 @@ jobs: working-directory: source if: matrix.discovery == 'k8s' run: | - if [ ${{ matrix.profile }} = "emqx-enterprise" ]; then - chart_name="emqx-ee" - else - chart_name="emqx" - fi - - helm install emqx \ + helm install ${{ matrix.profile }} \ --set emqxConfig.EMQX_CLUSTER__DISCOVERY_STRATEGY="k8s" \ --set emqxConfig.EMQX_CLUSTER__K8S__APISERVER="https://kubernetes.default.svc:443" \ - --set emqxConfig.EMQX_CLUSTER__K8S__SERVICE_NAME="emqx-headless" \ + --set emqxConfig.EMQX_CLUSTER__K8S__SERVICE_NAME="${{ matrix.profile }}-headless" \ --set emqxConfig.EMQX_CLUSTER__K8S__NAMESPACE="default" \ --set image.repository=$TARGET \ --set image.pullPolicy=Never \ @@ -172,22 +166,16 @@ jobs: --set emqxConfig.EMQX_ZONES__DEFAULT__MQTT__MAX_TOPIC_ALIAS=10 \ --set emqxConfig.EMQX_AUTHORIZATION__SOURCES=[] \ --set emqxConfig.EMQX_AUTHORIZATION__NO_MATCH=allow \ - deploy/charts/${chart_name} \ + deploy/charts/${{ matrix.profile }} \ --debug - name: run emqx on chart working-directory: source if: matrix.discovery == 'dns' run: | - if [ ${{ matrix.profile }} = "emqx-enterprise" ]; then - chart_name="emqx-ee" - else - chart_name="emqx" - fi - - helm install emqx \ + helm install ${{ matrix.profile }} \ --set emqxConfig.EMQX_CLUSTER__DISCOVERY_STRATEGY="dns" \ --set emqxConfig.EMQX_CLUSTER__DNS__RECORD_TYPE="srv" \ - --set emqxConfig.EMQX_CLUSTER__DNS__NAME="emqx-headless.default.svc.cluster.local" \ + --set emqxConfig.EMQX_CLUSTER__DNS__NAME="${{ matrix.profile }}-headless.default.svc.cluster.local" \ --set image.repository=$TARGET \ --set image.pullPolicy=Never \ --set image.tag=$EMQX_TAG \ @@ -196,13 +184,13 @@ jobs: --set emqxConfig.EMQX_ZONES__DEFAULT__MQTT__MAX_TOPIC_ALIAS=10 \ --set emqxConfig.EMQX_AUTHORIZATION__SOURCES=[] \ --set emqxConfig.EMQX_AUTHORIZATION__NO_MATCH=allow \ - deploy/charts/${chart_name} \ + deploy/charts/${{ matrix.profile }} \ --debug - name: waiting emqx started timeout-minutes: 10 run: | - while [ "$(kubectl get StatefulSet -l app.kubernetes.io/instance=emqx -o jsonpath='{.items[0].status.replicas}')" \ - != "$(kubectl get StatefulSet -l app.kubernetes.io/instance=emqx -o jsonpath='{.items[0].status.readyReplicas}')" ]; do + while [ "$(kubectl get StatefulSet -l app.kubernetes.io/instance=${{ matrix.profile }} -o jsonpath='{.items[0].status.replicas}')" \ + != "$(kubectl get StatefulSet -l app.kubernetes.io/instance=${{ matrix.profile }} -o jsonpath='{.items[0].status.readyReplicas}')" ]; do echo "=============================="; kubectl get pods; echo "=============================="; @@ -212,28 +200,13 @@ jobs: - name: Check cluster timeout-minutes: 10 run: | - kubectl port-forward svc/emqx 18083:18083 & + kubectl port-forward service/${{ matrix.profile }} 18083:18083 > /dev/null & while [ "$(curl --silent --basic -u admin:public -X GET http://127.0.0.1:18083/api/v5/cluster| jq '.nodes|length')" != "3" ]; do - echo "waiting emqx cluster scale" + echo "waiting ${{ matrix.profile }} cluster scale" sleep 1 done - - name: get emqx-0 pods log - if: failure() - run: | - kubectl describe pods emqx-0 - kubectl logs emqx-0 - - name: get emqx-1 pods log - if: failure() - run: | - kubectl describe pods emqx-1 - kubectl logs emqx-1 - - name: get emqx-2 pods log - if: failure() - run: | - kubectl describe pods emqx-2 - kubectl logs emqx-2 - uses: actions/checkout@v2 with: repository: emqx/paho.mqtt.testing @@ -244,6 +217,7 @@ jobs: pip install pytest echo "$HOME/.local/bin" >> $GITHUB_PATH - name: run paho test + timeout-minutes: 10 run: | port_connected () { local server="$1" @@ -251,7 +225,7 @@ jobs: echo > /dev/tcp/${server}/${port} 2>/dev/null } - kubectl port-forward service/emqx 1883:1883 > /dev/null & + kubectl port-forward service/${{ matrix.profile }} 1883:1883 > /dev/null & while ! port_connected localhost 1883; do echo server not listening yet... @@ -259,3 +233,5 @@ jobs: done pytest -v paho.mqtt.testing/interoperability/test_client/V5/test_connect.py -k test_basic --host "127.0.0.1" + - if: failure() + run: kubectl logs -l "app.kubernetes.io/instance=${{ matrix.profile }}" -c emqx --tail=1000 diff --git a/deploy/charts/emqx-ee/Chart.yaml b/deploy/charts/emqx-enterprise/Chart.yaml similarity index 97% rename from deploy/charts/emqx-ee/Chart.yaml rename to deploy/charts/emqx-enterprise/Chart.yaml index 24323b4ef..e407ab0d9 100644 --- a/deploy/charts/emqx-ee/Chart.yaml +++ b/deploy/charts/emqx-enterprise/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -name: emqx-ee +name: emqx-enterprise icon: https://github.com/emqx.png description: A Helm chart for EMQX # A chart can be either an 'application' or a 'library' chart. diff --git a/deploy/charts/emqx-ee/README.md b/deploy/charts/emqx-enterprise/README.md similarity index 100% rename from deploy/charts/emqx-ee/README.md rename to deploy/charts/emqx-enterprise/README.md diff --git a/deploy/charts/emqx-ee/templates/StatefulSet.yaml b/deploy/charts/emqx-enterprise/templates/StatefulSet.yaml similarity index 100% rename from deploy/charts/emqx-ee/templates/StatefulSet.yaml rename to deploy/charts/emqx-enterprise/templates/StatefulSet.yaml diff --git a/deploy/charts/emqx-ee/templates/_helpers.tpl b/deploy/charts/emqx-enterprise/templates/_helpers.tpl similarity index 100% rename from deploy/charts/emqx-ee/templates/_helpers.tpl rename to deploy/charts/emqx-enterprise/templates/_helpers.tpl diff --git a/deploy/charts/emqx-ee/templates/certificate.yaml b/deploy/charts/emqx-enterprise/templates/certificate.yaml similarity index 100% rename from deploy/charts/emqx-ee/templates/certificate.yaml rename to deploy/charts/emqx-enterprise/templates/certificate.yaml diff --git a/deploy/charts/emqx-ee/templates/configmap.yaml b/deploy/charts/emqx-enterprise/templates/configmap.yaml similarity index 100% rename from deploy/charts/emqx-ee/templates/configmap.yaml rename to deploy/charts/emqx-enterprise/templates/configmap.yaml diff --git a/deploy/charts/emqx-ee/templates/ingress.yaml b/deploy/charts/emqx-enterprise/templates/ingress.yaml similarity index 100% rename from deploy/charts/emqx-ee/templates/ingress.yaml rename to deploy/charts/emqx-enterprise/templates/ingress.yaml diff --git a/deploy/charts/emqx-ee/templates/rbac.yaml b/deploy/charts/emqx-enterprise/templates/rbac.yaml similarity index 100% rename from deploy/charts/emqx-ee/templates/rbac.yaml rename to deploy/charts/emqx-enterprise/templates/rbac.yaml diff --git a/deploy/charts/emqx-ee/templates/secret.yaml b/deploy/charts/emqx-enterprise/templates/secret.yaml similarity index 100% rename from deploy/charts/emqx-ee/templates/secret.yaml rename to deploy/charts/emqx-enterprise/templates/secret.yaml diff --git a/deploy/charts/emqx-ee/templates/service-monitor.yaml b/deploy/charts/emqx-enterprise/templates/service-monitor.yaml similarity index 100% rename from deploy/charts/emqx-ee/templates/service-monitor.yaml rename to deploy/charts/emqx-enterprise/templates/service-monitor.yaml diff --git a/deploy/charts/emqx-ee/templates/service.yaml b/deploy/charts/emqx-enterprise/templates/service.yaml similarity index 100% rename from deploy/charts/emqx-ee/templates/service.yaml rename to deploy/charts/emqx-enterprise/templates/service.yaml diff --git a/deploy/charts/emqx-ee/values.yaml b/deploy/charts/emqx-enterprise/values.yaml similarity index 100% rename from deploy/charts/emqx-ee/values.yaml rename to deploy/charts/emqx-enterprise/values.yaml