Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Prequisite:

...

  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

...

  1. Save the attached script

    View file
    namepostgresql_create.sql
    to the file. Execute the script to create all the necessary tables in the ese-db.

    Code Block
    languagebash
    psql -h localhost -p 5432 -U postgres -d ese-db -a -f postgresql_create.sql
  2. Save the attached script

    View file
    namecreate-users.sql
    to the file. If asked “Password for user postgres: ", input the value of the PGPASSWORD variable.

    Code Block
    languagebash
    psql -h localhost -p 5432 -U postgres -d ese-db -a -f create-users.sql
  3. Check your work. If asked “Password for user postgres: ", input the value of the PGPASSWORD variable.

    Code Block
    languagebash
    psql -h localhost -p 5432 -U postgres -d ese-db -c 'SELECT * from public.users;'

You can optionally install a UI client e.g. pgAdmin https://www.pgadmin.org/download/ , add a connection (localhost for port forwarding) and check tables manually.

Setting up the ESE license as a ConfigMap

...

  1. 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 of PGPASSWORD variable.

    View file
    nameconfig.xml

  2. In the hivemq namespace create a configMap ese-config from the file config.xml

    Code Block
    languagebash
    kubectl create configmap ese-config --from-file config.xml --namespace hivemq
  3. Edit values.yaml file of hivemq-operator and update section hivemq.extensions, having name: hivemq-enterprise-security-extension
    Update the old hivemq-enterprise-security-extension block from this:

    Code Block
    languageyaml
        - 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
    languageyaml
        - 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 
  4. 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

  5. If everything is correct, The HiveMQ log contains info about using the correct license:

...