...
...
...
A running Kubernetes cluster (we use AKS cluster with Kubenetes API 1.28)
A PostgreSQL client installed locally (we use psql (PostgreSQL) 14.10)
Prequisite: A running Kubernetes cluster. In this article, AKS v.1.28 is used.
If you are not logged in, please use the following commands to log in to your Azure cluster, please replace the group and name as needed. (Our reference: Setting up AKS Cluster in Azure | Set Up Your Kubernetes Cluster With AKS)
Code Block |
---|
az login |
Code Block |
---|
az aks get-credentials -g hmqResourceGroup -n HiveMQCluster |
...
Table of Contents |
---|
Prequisite:
Access to infrastructure with Kubectl
Running HiveMQ Cluster Install HiveMQ using Kubernetes Operator
Values.yaml file https://hivemq.atlassian.net/wiki/spaces/HMS/pages/2691039283/Install+HiveMQ+using+Kubernetes+Operator#Add-Helm-repository-and-download-values.yaml-file
A PostgreSQL client installed locally (we use psql (PostgreSQL) 14.10)
Installation of PostgreSQL server
...
Add the PostgreSQL repo to your Helm:
Code Block language bash helm repo add bitnami https://charts.bitnami.com/bitnami
Update the repo to the latest version:
Code Block language bash helm repo update bitnami
Create a new namespace to place the PostgreSql in:
Code Block kubectl create namespace db
Switch the KubeCtl context to the new namespace:
Code Block kubectl config set-context --current --namespace=db
Install PostgreSQL to the new namespace:
Code Block language bash helm upgrade postgres --install bitnami/postgresql --namespace db
If everything is correct, then PostgreSQL in installed to namespace “db”. The default name for the admin user is “postgres”. To get the password for "postgres" user run the following command and note the password:
Code Block language bash export PGPASSWORD=$(kubectl get secret --namespace db postgres-postgresql -o jsonpath="{.data.postgres-password}" | base64 -d) && echo $PGPASSWORD
...
Code Block |
---|
2024-01-30 10:36:12,693 INFO - Using valid license (ese-license.elic) for enterprise extension with name "HiveMQ Enterprise Security Extension", valid until 2024-03-31. 2024-01-30 10:36:12,943 INFO - Starting extension with id "hivemq-enterprise-security-extension" at /opt/hivemq/extensions/hivemq-enterprise-security-extension 2024-01-30 10:36:13,599 INFO - HiveMQ Enterprise Security Extension: Successfully loaded configuration from '/opt/hivemq/extensions/hivemq-enterprise-security-extension/conf/config.xml'. 2024-01-30 10:36:13,602 INFO - Starting HiveMQ Enterprise Security Extension. 2024-01-30 10:36:14,152 INFO - Started HiveMQ Enterprise Security Extension successfully in 1206ms. 2024-01-30 10:36:14,152 INFO - Extension "HiveMQ Enterprise Security Extension" version 4.24.0 started successfully. |
End-to-end testing
Find the MQTTListenerURL or IP using the following command (hivemq-hivemq-mqtt in our case with IP 20.79.142.120)
Code Block kubectl get services --namespace hivemq
Subscribe (update url/ip for host, taken from last step, localhost in case of port forward)
Code Block language bash mqtt subscribe --topic "topic/+/status" --qos 1 --host 20.79.142.120 --port 1883 --showTopics \ --user backendservice --password backendpassword
Publish (update url/ip for host, taken from last step, localhost in case of port forward)
Code Block language bash mqtt publish --identifier TheClient1 --topic topic/TheClient1/status \ --host 20.79.142.120 --port 1883 --qos 1 \ --user frontendclient --password clientpassword --message "test"
If everything is correct, the subscriber will receive
Test
\uD83D\uDCCB Related articles
...
receive
Test
Next steps
Please read official documentation for more configuration options https://docs.hivemq.com/hivemq-enterprise-security-extension/latest/index.html