Upgrade KubeMQ
Upgrade KubeMQ to the latest release with kmq, Docker, Compose or Helm, check what you run, roll back safely and leave the old combined chart.
This page upgrades a running KubeMQ installation to the latest release. When you finish, kmq license shows the new release in its VERSION column, the license is still active, and a test message round-trips. Time: about 15 minutes.
Commands use the default names kubemq-operator, messaging, kubemq and the namespace kubemq; use your own if they differ.
These commands are for bash on macOS and Linux. On Windows, run them in WSL (Windows Subsystem for Linux), or use the kmq tab of Try KubeMQ, which runs natively on Windows.
Before you start
-
Update kmq, the KubeMQ command-line tool:
kmq updateYou should see:
Output HARNESS_OUTPUT_PENDINGIf kmq reports
unknown command "update", re-run the installer from Try KubeMQ. -
Find what you run: the VERSION column of
kmq license(on Kubernetes,kmq license --kube-context YOUR_KUBE_CONTEXT). For Helm, list the releases:helm list --kube-context YOUR_KUBE_CONTEXT -AReplace:
YOUR_KUBE_CONTEXT— your cluster's kubectl context;kubectl config get-contextslists them.If one Helm release holds both the operator and the cluster, go to Move from the old combined chart release first. Artifact names: Requirements and supported setups.
-
Read Release notes for each release after yours, especially "Before you upgrade".
-
Back up: on one server, steps 1 to 4 of Back up and restore. For Kubernetes, contact support before relying on a restore.
Steps
Upgrade one server
Upgrade the server
kmq deploy update --installation kubemq --deadline 10mYou should see:
HARNESS_OUTPUT_PENDINGThe kubemq-data volume and your data stay.
Pull the latest image
docker pull --platform linux/amd64 europe-docker.pkg.dev/kubemq/images/kubemq-next:latestYou should see:
HARNESS_OUTPUT_PENDINGRemove the old container
docker stop kubemqdocker rm kubemqCheck that the volume stays:
docker volume ls --filter name=kubemq-data --format '{{.Name}}'You should see:
HARNESS_OUTPUT_PENDINGStart the server again
In kubemq-private, rerun your install command; from Install with Docker, that is:
docker run -d \ --pull always \ --platform linux/amd64 \ --name kubemq \ --hostname kubemq \ -p 127.0.0.1:50000:50000 \ -p 127.0.0.1:9090:9090 \ -p 127.0.0.1:8080:8080 \ -p 127.0.0.1:9092:9092 \ --env-file kubemq-license.env \ -e STORE_ENGINE=next \ -e STORE_NEXT_ACK_POLICY=strict \ -e STORE_STORE_PATH=/kubemq/store \ -e API_BIND_ADDRESS=0.0.0.0 \ -v kubemq-data:/kubemq/store \ europe-docker.pkg.dev/kubemq/images/kubemq-next:latestCheck that the server is running:
docker ps --filter name=kubemq --format '{{.Names}}: {{.Status}}'You should see:
HARNESS_OUTPUT_PENDINGWith Docker Compose, run docker compose pull, then docker compose up -d. With Podman, use podman in place of docker.
Then check the license:
kmq licenseYou should see:
HARNESS_OUTPUT_PENDINGVERSION shows the new release; STATE is unchanged. If kmq cannot connect, the server is still starting: wait a few seconds and run it again. Sign in at http://localhost:8080: your channels are still there.
Upgrade a Kubernetes cluster
Upgrade the cluster
kmq deploy update --installation messaging --deadline 20mYou should see:
HARNESS_OUTPUT_PENDINGkmq applies the custom resource definitions first, then upgrades the operator and cluster.
Data loss: do not use --reuse-values
--reuse-values keeps the old chart's images: the servers stay on the old release, and a later rollback can meet a store it cannot read.
Update the custom resource definitions
Helm never upgrades them itself.
helm show crds kubemq-next/kubemq-next | kubectl --context YOUR_KUBE_CONTEXT apply --server-side --force-conflicts -f -You should see:
HARNESS_OUTPUT_PENDINGUpgrade the operator
helm upgrade --install kubemq-operator kubemq-next/kubemq-next --kube-context YOUR_KUBE_CONTEXT -n kubemq \
--set operator.enabled=true --set cluster.enabled=false --waitYou should see:
HARNESS_OUTPUT_PENDINGThe servers then restart one at a time on the release the operator sets.
Upgrade the cluster
In kubemq-private, where cluster-values.yaml lives:
helm upgrade --install messaging kubemq-next/kubemq-next --kube-context YOUR_KUBE_CONTEXT -n kubemq -f cluster-values.yamlYou should see:
HARNESS_OUTPUT_PENDINGThen wait until every server is ready:
kubectl --context YOUR_KUBE_CONTEXT -n kubemq wait --for=condition=Ready kubemqclusters.next.kubemq.io/messaging --timeout=10mReplace: YOUR_KUBE_CONTEXT — your cluster's kubectl context; kubectl config get-contexts lists them.
You should see:
HARNESS_OUTPUT_PENDINGCheck the license:
kmq license --kube-context YOUR_KUBE_CONTEXTYou should see:
HARNESS_OUTPUT_PENDINGThen send a test message as in Install on Kubernetes.
Roll back
A store written by a newer release may not be readable by an older one. Roll back only when the release notes say the upgrade is reversible: install the previous release as "Pin a version" shows, and on Kubernetes also run helm rollback for the operator. Otherwise, restore your backup as in Back up and restore; for Kubernetes, contact support first.
Move from the old combined chart release
Older charts put the operator and the cluster in one Helm release. The current chart refuses a release that enables both: operator and cluster must use independent releases. Contact support before upgrading a release that contains both the operator and the cluster.
If something goes wrong
- The servers still run the old release. Run the wait command again. If they stay old, repeat the Helm steps without
--reuse-values. - A server restarts with a storage error in its log. Restore your backup and check the release notes.
- A licensing message in the log. Look up the anchor it prints in Troubleshooting.
Next steps
Was this page helpful?
Production checklist
Everything that must be true before KubeMQ takes production traffic: cluster shape, license, security, network, backups, monitoring and your applications.
Move from legacy KubeMQ
For teams on KubeMQ v2 and v3 up to v3.1.x, the older kubemq image or kubemq-io/charts Helm charts: what changes and how to get a guided migration.