...
...
...
...
...
Microsoft Azure Account
...
Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
If you do not have a valid HiveMQ license, the HiveMQ cluster uses a trial licence that allows up to 25 concurrent client connections and is limited to testing and evaluation purposes only. To obtain a HiveMQ licence that is suitable for production use, or request an evaluation licence that allows more connections, contact our customer service team. |
Info |
---|
While creating this guide, our Kubernetes Version is v1.27.7, it might be different in your case |
Requirements
Microsoft Azure Account
HiveMQ License (optional)
Azure CLI
The Azure command-line interface is used to create and manage Azure resources. In this procedure, you use the Azure CLI to create an Azure Resource Group with a Kubernetes cluster on the Azure cloud.
To install the Azure CLI on macOS with Homebrew, open a terminal and enter :
Code Block |
---|
brew install az |
the following. For other operating systems, see Azure CLI installation.
Code Block |
---|
brew install az |
kubectl
Kubectl is the official command-line interface for interacting with Kubernetes clusters. Here, you use kubectl to manage the created Kubernetes cluster on Azure.
Once you install Azure CLI, you can enter the following command to install kubectl on any operating system:
...
Helm
Helm is the most commonly used package manager for Kubernetes. Helm helps you easily define, install, and update the software that you run on a Kubernetes cluster. In this procedure, you use Helm to install and configure HiveMQ on your K8s cluster.
To install Helm on macOS with Homebrew, enter:
...
For other operating systems, see MQTT-CLI installation.
Procedure
Set Up Your Kubernetes Cluster With AKS
To create a Kubernetes cluster on Azure with the Azure CLI, open a terminal and enter:
Code Block |
---|
az login |
A window to sign in to your Microsoft account opens in your browser
...
. After you successfully submit your credentials, a sign-in confirmation prints in your terminal.
...
Before you create the cluster, you need to select the region where the cluster is hosted. To view a list of all available locations, enter:
Code Block |
---|
az account list-locations |
Excerpt of Azure locations JSON
Code Block |
---|
...
},
{
"displayName": "Germany North",
"id": "/subscriptions/661ab844-9998-4e03-b857-62ecbd9f34e8/locations/germanynorth",
"metadata": {
"geographyGroup": "Europe",
"latitude": "53.073635",
"longitude": "8.806422",
"pairedRegion": [
{
"id": "/subscriptions/661ab844-9998-4e03-b857-62ecbd9f34e8/locations/germanywestcentral",
"name": "germanywestcentral",
"subscriptionId": null
}
],
"physicalLocation": "Berlin",
"regionCategory": "Other",
"regionType": "Physical"
},
"name": "germanynorth",
"regionalDisplayName": "(Europe) Germany North",
"subscriptionId": null
},
... |
To create an Azure Resource Group with all the necessary resources for your cluster, enter the following command with the desired location (in this procedure, we use
germanywestcentral
):
Code Block |
---|
az group create --name hmqResourceGroup --location germanywestcentral |
In case you get the following error , you can fix it by setting subscription for your account
The client XYZ with object id 'ABCD' does not have authorization to perform action 'Microsoft.Resources/subscriptions/resourcegroups/write' over scope or the scope is invalid. If access was recently granted, please refresh your credentials.
Code: AuthorizationFailed
Steps to fix the error:
1. go to subscriptions under your azure account and look for subscription ID
2. Run the following command to set subscription for your account:az account set --subscription subscriptionID
To create a four-node AKS-managed Kubernetes cluster in your resource group with the Azure virtual machine type
Standard_A8_v2 (8 CPUs, 16 GiB RAM)
, enter the following command and wait until the process completes.
...
Processing time can vary:
Code Block |
---|
az aks create -g hmqResourceGroup -n HiveMQCluster --node-count 4 --node-vm-size Standard_A8_v2 |
Your Microsoft Azure account bills you for all resources you create. |
To manage the resulting Kubernetes cluster with kubectl, download the access credentials of the cluster:
Code Block |
---|
az aks get-credentials -g hmqResourceGroup -n HiveMQCluster |
To verify that all four nodes are available, enter:
Code Block |
---|
kubectl get nodes |
...