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/HMSKB/pages/2691039283/Install+HiveMQ+using+Kubernetes+Operator#Add-Helm-repository-and-download-values.yaml-file
Kubectl, Helm and MQTT CLI Prerequisite - Software Packages
Installation of PostgreSQL Client
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
...
Download a simple configuration file for Enterprise Security Extensions in the example below.
Replace the “password” in<db-password>password</db-password>
with the value ofPGPASSWORD
variable.View file name config.xml In the hivemq namespace create a configMap ese-config from the file config.xml
Code Block language bash kubectl create configmap ese-config --from-file config.xml --namespace hivemq
Edit values.yaml file of
hivemq-operator
and update section hivemq.extensions, havingname: hivemq-enterprise-security-extension
Update the old hivemq-enterprise-security-extension block from this:Code Block language yaml - name: hivemq-enterprise-security-extension extensionUri: preinstalled enabled: false # Note that this is just an example initialization routine. Make sure this points to the current JDBC version you require for your configuration. initialization: | # Download JDBC driver for PostgreSQL [[ ! -f drivers/postgres-jdbc.jar ]] && curl -L https://jdbc.postgresql.org/download/postgresql-42.2.14.jar --output drivers/jdbc/postgres.jar
To this:
Code Block language yaml - name: hivemq-enterprise-security-extension extensionUri: preinstalled enabled: true configMap: ese-config initialization: | [[ ! -f conf/config.xml ]] && [[ -f /conf-override/extensions/hivemq-enterprise-security-extension/config.xml ]] && ln -s /conf-override/extensions/hivemq-enterprise-security-extension/config.xml conf/config.xml && [[ ! -f drivers/postgres-jdbc.jar ]] && curl -L https://jdbc.postgresql.org/download/postgresql-42.7.1.jar --output drivers/jdbc/postgres.jar
Re-deploy hivemq-operator with updated values.yaml
Code Block helm upgrade hivemq --install hivemq/hivemq-operator --values values.yaml --namespace hivemq
– for ease of use we switch the namespace back to hivemq
kubectl config set-context --current --namespace=hivemq
If everything is correct, The HiveMQ log contains info about using the correct license:
...