Versions Compared

Key

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

Challenge

The HiveMQ operator (since 0.9.0) as well as the HiveMQ Docker images (since 4.6.4) introduced some breaking changes. The. following manual shows how to execute a zero downtime rolling upgrade from older operator and HiveMQ versions.

Prerequisites:

  1. k8s version 1.16+ is installed

  2. Helm version 3 is installed

  3. The Hivemq k8s operator repo is already added in helm repo

...

Instructions:

Here In the following guide, we will show outline the necessary essential steps for performing a zero-downtime upgrade of both the HiveMQ Kubernetes (k8s) operator as well as and HiveMQ itself.

Upgrade hivemq version without downtime. Hivemq By carefully following the instructions below, you will be able to successfully upgrade to HiveMQ version 4.6.4 should be running without error using , and ensure that it is running smoothly with the k8s operator version 0.9.2.

Steps to follow:

Hivemq cluster values Example of hivemq-cluster.yaml file:

Code Block
apiVersion: hivemq.com/v1
kind: HiveMQCluster
metadata:
  name: hivemq-dev
spec:
  env:
  - name: TEST_ENV
    value: 'set'

Example of HiveMQ operator values.yaml file: 

Code Block
languagebash
monitoring:
  enabled: true
operator:
  admissionWebhooks:
    enabled: false
    failurePolicy: Fail
  deployCr: false
  logLevel: DEBUG
  1. Deploy Hivemq operator with 0.8.7

    Code Block
    languagebash
    helm upgrade --version 0.8.7 --install -f operator.yaml <release name> hivemq/hivemq-operator

...

  1. Deploy Hivemq cluster with hivemq 4.6.2

...

  1. Code Block
    languagebash
    kubectl apply -f <hivemq-cluster.yaml>
  2. Simply apply the new CRD using the following command (considering k8s version is 1.16+)
    Note: This step can be skipped if you are using BladeCenter.

    Code Block
    languagebash
    kubectl apply -f https://raw.githubusercontent.com/hivemq/helm-charts/prerelease-4.6.4/charts/hivemq-operator/crds/hivemq-cluster.yaml
  3. Scale operator to 0 so it doesn’t immediately reconcile. This will only remove the operator pod, but leave the HiveMQ nodes as remaining

    Code Block
    kubectl scale —replicas=0 deployment <operator name>
  4. Edit hivemq cluster yaml to update the hivemq version as 4.6.4

  5. Apply the changes

    Code Block
    Kubectl apply -f <hivemq cluster.yaml>
  6. check the pods status(no errors)

    Code Block
    kubectl get pods
  7. Update

...

  1. operator version i.e 0.9.2 in the cluster(operator config File or command line)

  2. Run the following command for a rolling upgrade

    Code Block
    helm upgrade --version 0.9.2 --install -f operator.yaml <release name> hivemq/hivemq-operator

...

Filter by label (Content by label)
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@957
sortmodified
showSpacefalse
reversetrue
typepage
cqllabel in ( "kubernetes" , "hivemq-operator" ) and type = "page" and space = "KB"
labelskb-how-to-article