How to use Kubernetes Secret to specify HiveMQ license with HiveMQ Operator.
HiveMQ requires a license as a file in /opt/hivemq/license
directory. There are 3 ways to add the license with HiveMQ Operator:
as a raw value in the values.yaml file,
as a configMap in the values.yaml file,
as a secret in the values.yaml file.
This article explains how to use Kubernetes Secret to specify a HiveMQ license with HiveMQ Operator.
\uD83D\uDCD8 Instructions
Edit the values.yaml file to specify that the license file is contained in
hivemq-license
secret, which will be mounted to the directory/opt/hivemq/license
hivemq: ... secrets: # Secrets to mount to the HiveMQ pods. These can be mounted to existing directories without shadowing the folder contents as well. - name: hivemq-license path: /opt/hivemq/license ...
If there is no namespace for the HiveMQ, then create one and switch the
kubectl
context to itkubectl create ns hivemq kubectl ns hivemq
Create the secret with nave
hivemq-license
in the namespacehivemq
from the license filehivemq-2023.lic
kubectl create secret generic hivemq-license \ --from-file hivemq-license.lic \ --namespace hivemq
Install HiveMQ with the release name
hivemq-mine
from the Helm charthivemq-operator
to the namespacehivemq
and use parameter values from the filevalues.yaml
helm upgrade hivemq-mine \ --install hivemq/hivemq-operator \ --namespace hivemq\ --values values.yaml