Install Operator and Deploy EMQX
This section guides you through preparing the environment for EMQX Operator, installing the Operator itself, and using it to deploy EMQX. By following the steps provided, you can install and manage EMQX efficiently and reliably with the Operator.
Prepare the Environment
Before deploying EMQX Operator, ensure that the following components are ready:
A Kubernetes environment running Kubernetes version 1.24 or higher.
A kubectl tool that can access the Kubernetes cluster. You can check the status of the Kubernetes cluster using
kubectl cluster-infocommand.
Install EMQX Operator
Install the EMQX Operator with the command below:
bash$ kubectl apply --server-side=true -f https://github.com/emqx/emqx-operator/releases/latest/download/install.yamlThis command will download the latest 2.3.x release, install cluster-wide EMQX CRDs and deploy controller services into a separate
emqx-operator-systemnamespace.Wait till EMQX Operator is ready:
bash$ kubectl wait --for=condition=Ready pods --namespace emqx-operator-system -l "control-plane=controller-manager" pod/emqx-operator-controller-manager-57bd7b8bd4-h2mcr condition met
Once the Operator is running, you can proceed to deploy EMQX.
Deploy EMQX
Save the following content as a YAML file and deploy it with the
kubectl apply.yamlapiVersion: apps.emqx.io/v2 kind: EMQX metadata: name: emqx spec: image: emqx/emqx:6.1.1 config: data: | license { key = "..." }For more details about the EMQX CRD, check out the reference documentation.
Wait until the EMQX cluster is ready.
bash$ kubectl get emqx NAME STATUS AGE emqx Ready 2m55sMake sure the
STATUSisReady. It may take some time for the EMQX cluster to become ready.
Troubleshooting
EMQX Operator exposes a limited number of events to the Kubernetes API.
kubectl get events --sort-by=.lastTimestampAlternatively, if EMQX resources fail to reach Ready status condition, consult the controller manager logs for more details:
kubectl logs -l "control-plane=controller-manager" --tail=-1 --namespace emqx-operator-systemDeploy on Public Cloud
Use the following guides to deploy EMQX on managed Kubernetes services using the EMQX Operator: