EMQX: The most scalable open-source MQTT broker for IoT. For details:EMQX docs
EMQX Operator: A Kubernetes Operator for EMQX. For details:EMQX Operator docs
AKS: Azure Kubernetes Service (AKS) simplifies deploying a managed Kubernetes cluster in Azure by offloading the operational overhead to Azure. As a hosted Kubernetes service, Azure handles critical tasks, like health monitoring and maintenance. Since Kubernetes masters are managed by Azure, you only manage and maintain the agent nodes. For details:Azure docs
Log in to the Azure AKS dashboard, go to the Kubernetes service, and create a Kubernetes cluster. EMQX Operator requires Kubernetes version >= 1.20.0, so we choose Kubernetes 1.22.11 here, and network and other resource information according to your needs. For details
It is recommended to connect through the Cloud Shell provided by Azure. For details
NSF file storage is used here. Other StorageClass, please refer to storage class
Create StroageClass
cat << "EOF" | kubectl apply -f -
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: azurefile-csi-nfs
provisioner: file.csi.azure.com
allowVolumeExpansion: true
parameters:
protocol: nfs
mountOptions:
- nconnect=8
EOF
Check if the StroageClass was created successfully
kubectl get sc
You can see that azurefile-csi-nfs
has been successfully created
Operator installation refer to Operator docs
After the Operator installation is complete, deploy the EMQX cluster on Azure using the following yaml
cat << "EOF" | kubectl apply -f -
apiVersion: apps.emqx.io/v1beta3
kind: EmqxEnterprise
metadata:
name: emqx-ee
labels:
"foo": "bar"
spec:
replicas: 3
persistent:
storageClassName: azurefile-csi-nfs
resources:
requests:
storage: 4Gi
accessModes:
- ReadWriteOnce
emqxTemplate:
image: emqx/emqx-ee:4.4.8
serviceTemplate:
spec:
type: LoadBalancer
EOF
Here the service type is LoadBalancer
Since Azure LoadBalancer does not support TCP certificates, please refer to this document to resolve TCP certificate offloading issues.