Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

  1. A running Kubernetes cluster (we use AKS cluster with Kubenetes API 1.28)

  2. A PostgreSQL client installed locally (we use psql (PostgreSQL) 14.10)

    1. MacOS: brew install PostgreSQL

    2. Windows: link

    3. Linux: link

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:

Installation of PostgreSQL server

...

  1. Add the PostgreSQL repo to your Helm:

    Code Block
    languagebash
    helm repo add bitnami https://charts.bitnami.com/bitnami
  2. Update the repo to the latest version:

    Code Block
    languagebash
    helm repo update bitnami
  3. Create a new namespace to place the PostgreSql in:

    Code Block
    kubectl create namespace db
  4. Switch the KubeCtl context to the new namespace:

    Code Block
    kubectl config set-context --current --namespace=db

  5. Install PostgreSQL to the new namespace:

    Code Block
    languagebash
    helm upgrade postgres --install bitnami/postgresql --namespace db

  6. 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
    languagebash
    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

  1. 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

  2. Subscribe (update url/ip for host, taken from last step, localhost in case of port forward)

    Code Block
    languagebash
    mqtt subscribe --topic "topic/+/status" --qos 1 --host 20.79.142.120 --port 1883 --showTopics \
      --user backendservice --password backendpassword
  3. Publish (update url/ip for host, taken from last step, localhost in case of port forward)

    Code Block
    languagebash
    mqtt publish --identifier TheClient1 --topic topic/TheClient1/status \
     --host 20.79.142.120 --port 1883 --qos 1 \
      --user frontendclient --password clientpassword --message "test"

  4. If everything is correct, the subscriber will receive Test

    Image Removed

...

  1. receive Test

    Image Added

Next steps

Please read official documentation for more configuration options https://docs.hivemq.com/hivemq-enterprise-security-extension/latest/index.html