Upgrade to v0.9.6
2 minute read
This page describes how to upgrade the United Manufacturing Hub to version 0.9.6. Before upgrading, remember to backup the database, Node-RED flows, and your cluster configuration.
Add Helm repo in UMHLens / OpenLens
Check if the UMH Helm repository is added in UMHLens / OpenLens.
To do so, from the top-left menu, select FIle > Preferences (or press CTRL + ,
).
Click on the Kubernetes tab and check if the Helm Chart section contains
the https://repo.umh.app
repository.
If it doesn’t, click the Add Custom Helm Repo button and fill in the following values:
- Helm repo name: united-manufacturing-hub
- URL: https://repo.umh.app
Then click Add.
Add new index to the database
In this version, a new index has been added to the processValueTabe
table,
allowing to speed up the queries.
Open a shell in the database
sudo $(which kubectl) exec -it $(sudo $(which kubectl) get pods --kubeconfig /etc/rancher/k3s/k3s.yaml -n united-manufacturing-hub -l app.kubernetes.io/component=timescaledb -o jsonpath="{.items[0].metadata.name}") --kubeconfig /etc/rancher/k3s/k3s.yaml -n united-manufacturing-hub -- psql -U postgres
This command will open a psql
shell connected to the default postgres database.
Create the index
Execute the following query:
CREATE INDEX ON processvaluetable(valuename, asset_id) WITH (timescaledb.transaction_per_chunk);
REINDEX TABLE processvaluetable;
This command could take a while to complete, especially on larger tables.
Type exit
to close the shell.
Clear Workloads
Some workloads need to be deleted before upgrading. This process does not delete any data, but it will cause downtime. If a workload is missing, it means that it was not enabled in your cluster, therefore you can skip it.
To delete a resource, you can select it using the box on the left of the resource name and click the - button on the bottom right corner.
- Open the Workloads tab.
- From the Deployment section, delete the following deployments:
- united-manufacturing-hub-barcodereader
- united-manufacturing-hub-factoryinsight-deployment
- united-manufacturing-hub-kafkatopostgresql
- united-manufacturing-hub-mqttkafkabridge
- united-manufacturing-hub-iotsensorsmqtt
- united-manufacturing-hub-opcuasimulator-deployment
- From the StatefulSet section, delete the following statefulsets:
- united-manufacturing-hub-mqttbridge
- united-manufacturing-hub-hivemqce
- united-manufacturing-hub-nodered
- united-manufacturing-hub-sensorconnect
Upgrade Helm Chart
Now everything is ready to upgrade the Helm chart.
- Navigate to the Helm > Releases tab.
- Select the united-manufacturing-hub release and click Upgrade.
- In the Helm Upgrade window, make sure that the
Upgrade version
field contains the version you want to upgrade to. - You can also change the values of the Helm chart, if needed.
- Click Upgrade.
The upgrade process can take a few minutes. The upgrade is complete when the Status field of the release is Deployed.