├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── config.yml │ └── feature_request.md ├── actions │ ├── deploy-emqx │ │ └── action.yaml │ └── deploy-operator │ │ └── action.yaml ├── scripts │ ├── directory_check.py │ ├── generate_version.py │ └── remove_unused.py └── workflows │ ├── .gitlint │ ├── build-reloader-image.yaml │ ├── check-docs.yaml │ ├── check-helm.yaml │ ├── cts.yaml │ ├── deploy-docs.yaml │ ├── deploy.yaml │ ├── gitlint.yaml │ ├── issue-translate.yaml │ ├── issue.yaml │ ├── markdownlint.json │ ├── push-helm.yaml │ ├── release.yml │ ├── test.yaml │ └── upgrade.yaml ├── .gitignore ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE ├── LICENSES ├── Makefile ├── PROJECT ├── README.md ├── RELEASE.md ├── apis └── apps │ ├── v1beta3 │ ├── config_type.go │ ├── emqx_interface.go │ ├── emqxbroker_conversion.go │ ├── emqxbroker_conversion_test.go │ ├── emqxbroker_types.go │ ├── emqxenterprise_conversion.go │ ├── emqxenterprise_conversion_test.go │ ├── emqxenterprise_types.go │ ├── emqxplugin_conversion.go │ ├── emqxplugin_conversion_test.go │ ├── emqxplugin_types.go │ ├── groupversion_info.go │ ├── modules_test.go │ ├── modules_type.go │ ├── namer.go │ ├── servicetemplate.go │ ├── servicetemplate_test.go │ ├── status_types.go │ ├── status_types_test.go │ └── zz_generated.deepcopy.go │ ├── v1beta4 │ ├── emqxbroker_conversion.go │ ├── emqxbroker_types.go │ ├── emqxbroker_webhook.go │ ├── emqxbroker_webhook_test.go │ ├── emqxenterprise_conversion.go │ ├── emqxenterprise_types.go │ ├── emqxenterprise_webhook.go │ ├── emqxenterprise_webhook_test.go │ ├── emqxplugin_conversion.go │ ├── emqxplugin_types.go │ ├── emqxplugin_webhook.go │ ├── groupversion_info.go │ ├── rebalance_conversion.go │ ├── rebalance_conversion_test.go │ ├── rebalance_types.go │ ├── spec_types.go │ ├── status_types.go │ ├── status_types_test.go │ ├── types.go │ ├── util.go │ ├── util_test.go │ └── zz_generated.deepcopy.go │ ├── v2alpha1 │ ├── emqx_conversion.go │ ├── emqx_conversion_test.go │ ├── emqx_types.go │ ├── groupversion_info.go │ ├── names.go │ ├── status.go │ ├── status_test.go │ ├── util.go │ ├── util_test.go │ └── zz_generated.deepcopy.go │ └── v2beta1 │ ├── const.go │ ├── emqx_conversion.go │ ├── emqx_types.go │ ├── groupversion_info.go │ ├── names.go │ ├── rebalance_conversion.go │ ├── rebalance_types.go │ ├── rebalance_types_test.go │ ├── rebalance_webhook.go │ ├── rebalance_webhook_test.go │ ├── status.go │ ├── status_test.go │ ├── util.go │ ├── util_test.go │ ├── webhook_suite_test.go │ └── zz_generated.deepcopy.go ├── codecov.yaml ├── config ├── certmanager │ ├── certificate.yaml │ ├── kustomization.yaml │ └── kustomizeconfig.yaml ├── crd │ ├── bases │ │ ├── apps.emqx.io_emqxbrokers.yaml │ │ ├── apps.emqx.io_emqxenterprises.yaml │ │ ├── apps.emqx.io_emqxes.yaml │ │ ├── apps.emqx.io_emqxplugins.yaml │ │ └── apps.emqx.io_rebalances.yaml │ ├── kustomization.yaml │ ├── kustomizeconfig.yaml │ └── patches │ │ ├── cainjection_in_apps_rebalances.yaml │ │ ├── cainjection_in_emqxbrokers.yaml │ │ ├── cainjection_in_emqxenterprises.yaml │ │ ├── cainjection_in_emqxes.yaml │ │ ├── cainjection_in_emqxplugins.yaml │ │ ├── cainjection_in_rebalances.yaml │ │ ├── webhook_in_apps_rebalances.yaml │ │ ├── webhook_in_emqxbrokers.yaml │ │ ├── webhook_in_emqxenterprises.yaml │ │ ├── webhook_in_emqxes.yaml │ │ ├── webhook_in_emqxplugins.yaml │ │ └── webhook_in_rebalances.yaml ├── default │ ├── kustomization.yaml │ ├── manager_auth_proxy_patch.yaml │ ├── manager_config_patch.yaml │ ├── manager_webhook_patch.yaml │ └── webhookcainjection_patch.yaml ├── dev │ ├── cert │ │ ├── tls.crt │ │ └── tls.key │ ├── kustomization.yaml │ └── namespace.yaml ├── manager │ ├── controller_manager_config.yaml │ ├── kustomization.yaml │ └── manager.yaml ├── prometheus │ ├── kustomization.yaml │ └── monitor.yaml ├── rbac │ ├── apps_rebalance_editor_role.yaml │ ├── apps_rebalance_viewer_role.yaml │ ├── auth_proxy_client_clusterrole.yaml │ ├── auth_proxy_role.yaml │ ├── auth_proxy_role_binding.yaml │ ├── emqx_editor_role.yaml │ ├── emqx_rebalance_editor_role.yaml │ ├── emqx_rebalance_viewer_role.yaml │ ├── emqx_viewer_role.yaml │ ├── emqxbroker_editor_role.yaml │ ├── emqxbroker_viewer_role.yaml │ ├── emqxenterprise_editor_role.yaml │ ├── emqxenterprise_viewer_role.yaml │ ├── emqxplugin_editor_role.yaml │ ├── emqxplugin_viewer_role.yaml │ ├── kustomization.yaml │ ├── leader_election_role.yaml │ ├── leader_election_role_binding.yaml │ ├── role.yaml │ ├── role_binding.yaml │ └── service_account.yaml ├── samples │ └── emqx │ │ ├── v1beta3 │ │ ├── emqx-plugin.yaml │ │ ├── emqxbroker-full.yaml │ │ ├── emqxbroker-slim.yaml │ │ ├── emqxenterprise-full.yaml │ │ └── emqxenterprise-slim.yaml │ │ ├── v1beta4 │ │ ├── emqx-plugin.yaml │ │ ├── emqxbroker-full.yaml │ │ ├── emqxbroker-slim.yaml │ │ ├── emqxenterprise-full.yaml │ │ ├── emqxenterprise-slim.yaml │ │ └── rebalance.yaml │ │ ├── v2alpha1 │ │ ├── emqx-full.yaml │ │ └── emqx-slim.yaml │ │ └── v2beta1 │ │ ├── emqx-full.yaml │ │ ├── emqx-slim.yaml │ │ └── rebalance.yaml └── webhook │ ├── kustomization.yaml │ ├── kustomizeconfig.yaml │ ├── manifests.yaml │ └── service.yaml ├── controllers └── apps │ ├── v1beta4 │ ├── add_emqx_bootstrap_user.go │ ├── add_emqx_plugins.go │ ├── add_emqx_resources.go │ ├── add_emqx_statefulset.go │ ├── add_listener.go │ ├── emqx_controller.go │ ├── emqxbroker_controller.go │ ├── emqxenterprise_controller.go │ ├── emqxplugin_controller.go │ ├── generated.go │ ├── generated_test.go │ ├── statefulset.go │ ├── statefulset_util.go │ ├── update_emqx_status.go │ └── update_pod_conditions.go │ └── v2beta1 │ ├── add_bootstrap_resource.go │ ├── add_bootstrap_resource_suite_test.go │ ├── add_bootstrap_resource_test.go │ ├── add_emqx_core.go │ ├── add_emqx_core_suite_test.go │ ├── add_emqx_core_test.go │ ├── add_emqx_repl.go │ ├── add_emqx_repl_suite_test.go │ ├── add_emqx_repl_test.go │ ├── add_headless_svc.go │ ├── add_pdb.go │ ├── add_svc.go │ ├── add_svc_test.go │ ├── emqx_controller.go │ ├── rebalance_controller.go │ ├── rebalance_controller_test.go │ ├── status_machine.go │ ├── suite_test.go │ ├── sync_emqx_config.go │ ├── sync_emqx_config_test.go │ ├── sync_pods.go │ ├── sync_pods_suite_test.go │ ├── sync_sets.go │ ├── sync_sets_suite_test.go │ ├── update_emqx_status.go │ ├── update_pod_conditions.go │ ├── util.go │ └── util_test.go ├── crd-reference-config.yaml ├── deploy └── charts │ └── emqx-operator │ ├── .helmignore │ ├── Chart.yaml │ ├── README.md │ ├── templates │ ├── NOTES.txt │ ├── _helpers.tpl │ ├── cert-manager.yaml │ ├── controller-manager-leader-election-role.yaml │ ├── controller-manager-metrics-service.yaml │ ├── controller-manager-rbac.yaml │ ├── controller-manager-webhook-service.yaml │ ├── controller-manager.yaml │ ├── crd.emqxbrokers.apps.emqx.io.yaml │ ├── crd.emqxenterprises.apps.emqx.io.yaml │ ├── crd.emqxes.apps.emqx.io.yaml │ ├── crd.emqxplugins.apps.emqx.io.yaml │ ├── crd.rebalances.apps.emqx.io.yaml │ ├── webhook-mutating-configuration.yaml │ └── webhook-validating-configuration.yaml │ └── values.yaml ├── docs ├── README.md ├── directory.json ├── en_US │ ├── deployment │ │ ├── assets │ │ │ └── cert.png │ │ ├── on-aws-eks.md │ │ ├── on-azure-aks.md │ │ ├── on-gcp-gke.md │ │ └── overview.md │ ├── getting-started │ │ ├── getting-started.md │ │ └── hello-emqx-operator.md │ ├── index.md │ ├── introduction │ │ └── assets │ │ │ └── architecture.png │ ├── reference │ │ ├── overview.md │ │ ├── v1beta3-reference.md │ │ ├── v1beta4-reference.md │ │ ├── v2alpha1-reference.md │ │ ├── v2alpha2-reference.md │ │ └── v2beta1-reference.md │ └── tasks │ │ ├── assets │ │ ├── configure-core-replicant │ │ │ └── mria-core-repliant.png │ │ ├── configure-emqx-blueGreenUpdate │ │ │ └── grafana.png │ │ ├── configure-emqx-persistent │ │ │ ├── emqx-core-action.png │ │ │ ├── emqx-core-rule-new.png │ │ │ └── emqx-core-rule-old.png │ │ ├── configure-emqx-prometheus │ │ │ ├── emqx-grafana-dashboard.png │ │ │ ├── emqx-prometheus-metrics.png │ │ │ └── emqx-prometheus-target.png │ │ ├── configure-emqx-rebalance │ │ │ ├── after-rebalance.png │ │ │ └── before-rebalance.png │ │ ├── configure-log-collection │ │ │ ├── create-index-0.png │ │ │ ├── create-index-1.png │ │ │ ├── index-manage.png │ │ │ └── log-collection.png │ │ ├── configure-log-level │ │ │ └── emqx-debug-log.png │ │ ├── configure-service │ │ │ ├── emqx-add-listener.png │ │ │ └── emqx-listeners.png │ │ └── configure-tls │ │ │ ├── sub.png │ │ │ ├── tls-connect.png │ │ │ └── tls-test.png │ │ ├── configure-emqx-blueGreenUpdate.md │ │ ├── configure-emqx-config.md │ │ ├── configure-emqx-core-replicant.md │ │ ├── configure-emqx-license.md │ │ ├── configure-emqx-log-collection.md │ │ ├── configure-emqx-log-level.md │ │ ├── configure-emqx-persistence.md │ │ ├── configure-emqx-prometheus.md │ │ ├── configure-emqx-rebalance.md │ │ ├── configure-emqx-restricted-k8s.md │ │ ├── configure-emqx-service.md │ │ ├── configure-emqx-tls.md │ │ └── overview.md ├── preview.sh └── zh_CN │ ├── deployment │ ├── assets │ │ └── cert.png │ ├── on-alibaba-cloud.md │ ├── on-aws-eks.md │ ├── on-azure-aks.md │ ├── on-gcp-gke.md │ ├── on-huawei-cloud.md │ ├── on-tencent-cloud.md │ └── overview.md │ ├── getting-started │ └── getting-started.md │ ├── index.md │ ├── introduction │ └── assets │ │ └── architecture.png │ ├── reference │ ├── overview.md │ ├── v1beta3-reference.md │ ├── v1beta4-reference.md │ ├── v2alpha1-reference.md │ ├── v2alpha2-reference.md │ └── v2beta1-reference.md │ └── tasks │ ├── assets │ ├── configure-core-replicant │ │ └── mria-core-repliant.png │ ├── configure-emqx-blueGreenUpdate │ │ └── grafana.png │ ├── configure-emqx-persistent │ │ ├── emqx-core-action.png │ │ ├── emqx-core-rule-new.png │ │ └── emqx-core-rule-old.png │ ├── configure-emqx-prometheus │ │ ├── emqx-grafana-dashboard.png │ │ ├── emqx-prometheus-metrics.png │ │ └── emqx-prometheus-target.png │ ├── configure-emqx-rebalance │ │ ├── after-rebalance.png │ │ └── before-rebalance.png │ ├── configure-log-collection │ │ ├── create-index-0.png │ │ ├── create-index-1.png │ │ ├── index-manage.png │ │ └── log-collection.png │ ├── configure-log-level │ │ └── emqx-debug-log.png │ ├── configure-service │ │ ├── emqx-add-listener.png │ │ └── emqx-listeners.png │ └── configure-tls │ │ ├── sub.png │ │ ├── tls-connect.png │ │ └── tls-test.png │ ├── configure-emqx-blueGreenUpdate.md │ ├── configure-emqx-config.md │ ├── configure-emqx-core-replicant.md │ ├── configure-emqx-license.md │ ├── configure-emqx-log-collection.md │ ├── configure-emqx-log-level.md │ ├── configure-emqx-persistence.md │ ├── configure-emqx-prometheus.md │ ├── configure-emqx-rebalance.md │ ├── configure-emqx-restricted-k8s.md │ ├── configure-emqx-service.md │ ├── configure-emqx-tls.md │ └── overview.md ├── e2e ├── v1beta4 │ ├── e2e_base_test.go │ ├── e2e_blure_green_upgrade_test.go │ ├── e2e_upgrade_test.go │ └── suite_test.go └── v2beta1 │ ├── e2e_rebalance_test.go │ ├── e2e_test.go │ └── suite_test.go ├── go.mod ├── go.sum ├── hack └── boilerplate.go.txt ├── internal ├── errors │ └── errors.go ├── handler │ ├── handler.go │ └── handler_test.go └── requester │ └── requester.go ├── main.go ├── scripts ├── check-nl-at-eof.sh ├── check-space-at-eol.sh ├── create-api.sh ├── gen-helm-crds.sh ├── get-version.sh ├── pre-release.sh └── shellcheck.sh ├── sidecar └── reloader │ ├── Dockerfile │ ├── VERSION │ ├── go.mod │ ├── go.sum │ ├── main.go │ └── main_test.go ├── tls.crt └── tls.key /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | ## Default 2 | * @Rory-Z 3 | 4 | ## Docs 5 | /docs/ @emqx/cloud-native 6 | 7 | ## Release note 8 | /RELEASE.md @emqx/cloud-native 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 16 | **Expected behavior** 17 | A clear and concise description of what you expected to happen. 18 | 19 | **Anything else we need to know?**: 20 | 21 | **Environment details:**: 22 | - Kubernetes version: 23 | - Cloud-provider/provisioner: 24 | - emqx-operator version: 25 | - Install method: e.g. helm/static manifests 26 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: GitHub Community Support 4 | url: https://github.com/emqx/emqx-operator/discussions 5 | about: Please ask and answer questions here. 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/actions/deploy-emqx/action.yaml: -------------------------------------------------------------------------------- 1 | name: Deployment emqx by operator 2 | description: "Deployment emqx by operator, scale pod number, and check emqx cluster status" 3 | inputs: 4 | kind: 5 | description: "Kind name" 6 | required: true 7 | default: "emqx" 8 | name: 9 | description: "Resource name" 10 | required: true 11 | default: "emqx" 12 | file: 13 | description: "Yaml file path" 14 | required: true 15 | default: "config/samples/emqx/v1beta3/emqx.yaml" 16 | 17 | runs: 18 | using: "composite" 19 | steps: 20 | - name: Deployment emqx 21 | shell: bash 22 | run: kubectl apply -f ${{ inputs.file }} 23 | - name: Check emqx custom resource status 24 | shell: bash 25 | run: | 26 | while 27 | type="$(kubectl get ${{ inputs.kind }} ${{ inputs.name }} -o json |jq '.status.conditions[0] | select(.status == "True")' | jq --raw-output '.type')" 28 | [[ "$type" != "Ready" ]] && [[ "$type" != "Running" ]] 29 | do 30 | echo "waiting" 31 | sleep 1 32 | done 33 | - name: Check statefulSet doesn't update 34 | shell: bash 35 | run: | 36 | generation=$(kubectl get sts -l "apps.emqx.io/instance=${{ inputs.name }}" -o 'jsonpath={.items[0].status.observedGeneration}') 37 | if [ $generation != 1 ]; then 38 | kubectl get sts -l "apps.emqx.io/instance=${{ inputs.name }}" -o json 39 | exit 1; 40 | fi 41 | -------------------------------------------------------------------------------- /.github/actions/deploy-operator/action.yaml: -------------------------------------------------------------------------------- 1 | name: Deployment operator 2 | description: "Deployment operator" 3 | inputs: 4 | repository: 5 | description: "operator controller image repository" 6 | required: true 7 | default: "emqx/emqx-operator-controller" 8 | tag: 9 | description: "operator controller image tag" 10 | required: true 11 | default: "latest" 12 | 13 | runs: 14 | using: "composite" 15 | steps: 16 | - name: Install cert-manager 17 | shell: bash 18 | run: | 19 | cert_manager_version="" 20 | kube_min_version=$(kubectl version --output=yaml | yq '.serverVersion.minor') 21 | if [ ${kube_min_version} -le 21 ]; then 22 | cert_manager_version="v1.11.5" 23 | fi 24 | if [ ${kube_min_version} -le 20 ]; then 25 | cert_manager_version="v1.10.2" 26 | fi 27 | if [ ${kube_min_version} -le 19 ]; then 28 | cert_manager_version="v1.8.2" 29 | fi 30 | if [ ${kube_min_version} -le 18 ]; then 31 | cert_manager_version="v1.7.3" 32 | fi 33 | if [ ${kube_min_version} -le 17 ]; then 34 | cert_manager_version="v1.6.3" 35 | fi 36 | if [ ${kube_min_version} -le 16 ]; then 37 | cert_manager_version="v1.5.5" 38 | fi 39 | if [ ${kube_min_version} -le 15 ]; then 40 | echo "Kubernetes version is too low, please upgrade to 1.15+" 41 | exit 1 42 | fi 43 | 44 | helm repo add jetstack https://charts.jetstack.io 45 | helm repo update 46 | helm install \ 47 | cert-manager jetstack/cert-manager \ 48 | --namespace cert-manager \ 49 | --create-namespace \ 50 | --set crds.enabled=true \ 51 | --version "$cert_manager_version" 52 | - name: Deploy operator by helm 53 | shell: bash 54 | run: | 55 | repository=$(echo ${{ inputs.repository }} | tr '[:upper:]' '[:lower:]') 56 | tag=$(echo ${{ inputs.tag }} | tr '/' '-') 57 | helm install emqx-operator deploy/charts/emqx-operator\ 58 | --set image.repository=$repository \ 59 | --set image.tag=$tag \ 60 | --set development=true \ 61 | --namespace emqx-operator-system \ 62 | --create-namespace 63 | - name: Check operator 64 | shell: bash 65 | run: kubectl wait --for=condition=Ready pods -l "control-plane=controller-manager" -n emqx-operator-system 66 | -------------------------------------------------------------------------------- /.github/scripts/generate_version.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import json 3 | 4 | version_list = sys.argv[1:] 5 | 6 | if __name__ == '__main__': 7 | version_list.sort( 8 | key=lambda v: [int(u) for u in v.split('.')], 9 | reverse=True 10 | ) 11 | version_list = [f'v{version}' for version in version_list] 12 | version_list.insert(0, 'latest') 13 | print(json.dumps(version_list)) 14 | -------------------------------------------------------------------------------- /.github/scripts/remove_unused.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import json 4 | 5 | docs_path = sys.argv[1] 6 | 7 | 8 | def get_markdown_file(dir_config, base_path): 9 | current_files = [] 10 | for row in dir_config: 11 | if row.get('path'): 12 | current_files.append( 13 | f'{base_path}/index.md' if row['path'] == './' 14 | else f'{base_path}/{row["path"]}.md' 15 | ) 16 | if row.get('children'): 17 | current_files += get_markdown_file(row['children'], base_path) 18 | return current_files 19 | 20 | 21 | if __name__ == '__main__': 22 | r = open(f'{docs_path}/directory.json', 'r') 23 | directory_config = json.load(r) 24 | markdown_files = get_markdown_file(directory_config['cn'], f'{docs_path}/zh_CN') 25 | markdown_files += get_markdown_file(directory_config['en'], f'{docs_path}/en_US') 26 | 27 | for file_path, dir_list, file_list in os.walk(docs_path): 28 | for file_name in file_list: 29 | if not file_name.endswith('.md'): 30 | continue 31 | if os.path.join(file_path, file_name) not in markdown_files: 32 | print(f'Remove {os.path.join(file_path, file_name)}') 33 | os.remove(os.path.join(file_path, file_name)) 34 | -------------------------------------------------------------------------------- /.github/workflows/build-reloader-image.yaml: -------------------------------------------------------------------------------- 1 | name: Build Reloader Image 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | - "main-*" 8 | tags: 9 | - "*" 10 | paths: 11 | - sidecar/reloader/** 12 | 13 | jobs: 14 | build-reloader-image: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: actions/checkout@v4 18 | - name: Get reloader image version 19 | id: version 20 | run: | 21 | VERSION=$(cat sidecar/reloader/VERSION) 22 | echo "::set-output name=version::${VERSION}" 23 | - name: Get container registry 24 | id: registry 25 | run: | 26 | if [ ${{ github.ref_type }} = "tag" ]; then 27 | echo "::set-output name=registry::docker.io" 28 | else 29 | echo "::set-output name=registry::ghcr.io" 30 | fi 31 | - uses: docker/setup-qemu-action@v3 32 | - uses: docker/setup-buildx-action@v3 33 | - uses: docker/login-action@v3 34 | if: github.ref_type == 'tag' 35 | with: 36 | registry: docker.io 37 | username: ${{ secrets.DOCKER_HUB_USER }} 38 | password: ${{ secrets.DOCKER_HUB_TOKEN }} 39 | - uses: docker/login-action@v3 40 | if: github.ref_type == 'branch' 41 | with: 42 | registry: ghcr.io 43 | username: ${{ github.actor }} 44 | password: ${{ github.token }} 45 | - uses: docker/metadata-action@v5 46 | id: meta 47 | with: 48 | images: ${{ steps.registry.outputs.registry }}/${{ github.repository }}-reloader 49 | flavor: | 50 | latest=true 51 | tags: | 52 | type=semver,pattern={{version}},value=${{ steps.version.outputs.version }} 53 | - uses: docker/build-push-action@v5 54 | with: 55 | push: true 56 | pull: true 57 | no-cache: true 58 | platforms: linux/amd64,linux/arm64,linux/arm/v7 59 | tags: ${{ steps.meta.outputs.tags }} 60 | labels: ${{ steps.meta.outputs.labels }} 61 | context: sidecar/reloader 62 | -------------------------------------------------------------------------------- /.github/workflows/check-docs.yaml: -------------------------------------------------------------------------------- 1 | name: Check Docs 2 | 3 | on: [pull_request] 4 | 5 | jobs: 6 | check-docs-markdown: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: Check out code 10 | uses: actions/checkout@main 11 | - name: Install markdownlint 12 | run: sudo npm install -g markdownlint-cli 13 | - name: Markdown lint 14 | run: markdownlint -c .github/workflows/markdownlint.json ./ 15 | # - name: Markdown link check 16 | # uses: gaurav-nelson/github-action-markdown-link-check@v1 17 | # with: 18 | # use-quiet-mode: 'yes' 19 | # check-modified-files-only: 'yes' 20 | # base-branch: 'main' 21 | 22 | check-docs-directory: 23 | runs-on: ubuntu-latest 24 | steps: 25 | - name: Check out code 26 | uses: actions/checkout@main 27 | - name: check directory config 28 | run: python3 .github/scripts/directory_check.py directory.json $(pwd)/docs 29 | -------------------------------------------------------------------------------- /.github/workflows/check-helm.yaml: -------------------------------------------------------------------------------- 1 | name: Check Helm Version 2 | 3 | on: 4 | push: 5 | paths: 6 | - deploy/charts/emqx-operator/templates/** 7 | pull_request: 8 | paths: 9 | - deploy/charts/emqx-operator/templates/** 10 | 11 | jobs: 12 | check-helm-version: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - run: minikube start 16 | - uses: actions/checkout@v4 17 | - name: Update helm 18 | run: | 19 | helm repo add emqx https://repos.emqx.io/charts 20 | helm repo update 21 | - name: Check helm version 22 | run: | 23 | old=$(helm show chart emqx/emqx-operator |egrep "^version" | sed -r 's|^version:[[:space:]]([0-9]+.[0-9]+.[0-9]+)$|\1|g') 24 | now=$(egrep "^version" deploy/charts/emqx-operator/Chart.yaml | sed -r 's|^version:[[:space:]]([0-9]+.[0-9]+.[0-9]+)$|\1|g') 25 | if [ "$old" = "$now" ];then 26 | echo "Need update version for Chart.yaml" 27 | exit 1 28 | fi 29 | -------------------------------------------------------------------------------- /.github/workflows/gitlint.yaml: -------------------------------------------------------------------------------- 1 | name: Run Gitlint 2 | 3 | on: [pull_request] 4 | 5 | jobs: 6 | gitlint: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: Checkout source code 10 | uses: actions/checkout@v4 11 | - name: Install gitlint 12 | run: | 13 | sudo apt-get update 14 | sudo apt install gitlint 15 | - name: Run gitlint 16 | shell: bash 17 | run: | 18 | pr_number=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }') 19 | messages="$(curl --silent --show-error \ 20 | --header "${{ env.AUTH_HEADER }}" \ 21 | --header "Accept: application/vnd.github.v3+json" \ 22 | "https://api.github.com/repos/${GITHUB_REPOSITORY}/pulls/${pr_number}/commits")" 23 | len=$(echo $messages | jq length) 24 | result=true 25 | for i in $( seq 0 $(($len - 1)) ); do 26 | message=$(echo $messages | jq -r .[$i].commit.message) 27 | echo "commit message: $message" 28 | status=0 29 | echo $message | gitlint -C ./.github/workflows/.gitlint || status=$? 30 | if [ $status -ne 0 ]; then 31 | result=false 32 | fi 33 | done 34 | if ! ${result} ; then 35 | echo "Some of the commit messages are not structured as The Conventional Commits specification. Please check CONTRIBUTING.md for our process on PR." 36 | exit 1 37 | fi 38 | echo "success" 39 | -------------------------------------------------------------------------------- /.github/workflows/issue-translate.yaml: -------------------------------------------------------------------------------- 1 | name: Translate Issue from Chinese to English 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | issue_number: 7 | description: 'The issue number to translate' 8 | required: true 9 | type: string 10 | issues: 11 | types: [opened] 12 | 13 | jobs: 14 | translate: 15 | runs-on: ubuntu-latest 16 | permissions: 17 | issues: write # Grant permission to edit issues 18 | steps: 19 | - uses: emqx/translate-issue-action@ee63ec619dfc5808ee2093dba93dfd7ac3beb437 # v1.0.2 20 | with: 21 | issue_number: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.issue_number || github.event.issue.number }} 22 | gemini_api_key: ${{ secrets.GEMINI_API_KEY }} 23 | -------------------------------------------------------------------------------- /.github/workflows/issue.yaml: -------------------------------------------------------------------------------- 1 | name: Manage Stale Issues 2 | 3 | on: 4 | schedule: 5 | - cron: '0 */6 * * *' 6 | workflow_dispatch: 7 | 8 | jobs: 9 | stale: 10 | runs-on: ubuntu-latest 11 | permissions: 12 | issues: write 13 | pull-requests: none 14 | 15 | steps: 16 | - name: Close Stale Issues 17 | uses: actions/stale@v4.1.0 18 | with: 19 | days-before-stale: 7 20 | days-before-close: 7 21 | exempt-issue-labels: 'bug,enhancement' 22 | stale-issue-label: "#triage/stale" 23 | stale-issue-message: >- 24 | This issue has been automatically marked as stale because it has not had 25 | recent activity. It will be closed if no further activity occurs. Thank you 26 | for your contributions. 27 | # we don't want stalebot to analyze pull requests 28 | only-pr-labels: "ZZZDisabledZZZ" 29 | operations-per-run: 80 30 | -------------------------------------------------------------------------------- /.github/workflows/markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "default": false, 3 | "MD001": true, 4 | "MD003": { 5 | "style": "atx" 6 | }, 7 | "MD011": true, 8 | "MD018": true, 9 | "MD019": true, 10 | "MD023": true, 11 | "MD025": { 12 | "level": 1, 13 | "front_matter_title": "" 14 | }, 15 | "MD042": true, 16 | "MD046": { 17 | "style": "fenced" 18 | }, 19 | "MD048": { 20 | "style": "backtick" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /.github/workflows/push-helm.yaml: -------------------------------------------------------------------------------- 1 | name: Push Helm Chart 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | tag: 7 | required: true 8 | type: string 9 | release: 10 | types: 11 | - published 12 | 13 | jobs: 14 | helm: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: actions/checkout@v4 18 | - name: Get tag 19 | id: get_tag 20 | run: | 21 | if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then 22 | tag="${{ inputs.tag }}" 23 | fi 24 | if [ "${{ github.event_name }}" = "release" ]; then 25 | tag="${{ github.event.release.tag_name }}" 26 | fi 27 | echo "tag=$tag" >> $GITHUB_OUTPUT 28 | - name: Update helm repo 29 | uses: emqx/push-helm-action@v1.1 30 | with: 31 | charts_dir: "${{ github.workspace }}/deploy/charts/emqx-operator" 32 | version: ${{ steps.get_tag.outputs.tag }} 33 | aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} 34 | aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 35 | aws_region: "us-west-2" 36 | aws_bucket_name: "repos-emqx-io" 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Mac 2 | .DS_Store 3 | 4 | # Binaries for programs and plugins 5 | *.exe 6 | *.exe~ 7 | *.dll 8 | *.so 9 | *.dylib 10 | 11 | # Test binary, built with `go test -c` 12 | *.test 13 | 14 | # Output of the go coverage tool, specifically when used with LiteIDE 15 | *.out 16 | 17 | # Dependency directories (remove the comment below to include it) 18 | # vendor/ 19 | bin/ 20 | 21 | go.work 22 | go.work.sum 23 | 24 | cspell.config.yaml 25 | .vscode/ 26 | .idea/ 27 | 28 | *.tgz 29 | 30 | ginkgo.report 31 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | You are welcome to submit any bugs, issues and feature requests on this repository. 4 | 5 | 6 | ## Commit Message Guidelines 7 | 8 | We have very precise rules over how our git commit messages can be formatted. This leads to **more readable messages** that are easy to follow when looking through the **project history**. 9 | 10 | ### Commit Message Format 11 | 12 | Each commit message consists of a **header**, a **body** and a **footer**. The header has a special format that includes a **type**, a **scope** and a **subject**: 13 | 14 | ``` 15 | (): 16 | 17 | 18 | 19 |