Trendz Analytics Kubernetes 1.15.x Upgrade Instructions
Prepare for upgrading Trendz Analytics
Obtain Trendz Kubernetes scripts
Use the Kubernetes configuration files from your original installation. If you no longer have them, re-clone the repository and fill in your configuration values as described in the installation guide:
git clone https://github.com/thingsboard/trendz-k8s.git --depth 1Connect to your Kubernetes cluster
Select the correct kube-config context before running any commands:
kubectl config get-contextskubectl config use-context <your-config-name>Set trendz as the default namespace, so the commands below run in it:
kubectl config set-context --current --namespace=trendzBack up the database
Back up the trendz database with pg_dump or your PostgreSQL provider's backup tools.
Upgrading Trendz Analytics to 1.15.2.1 (latest 1.15.2 patch)
Update image versions
Set the image versions to 1.15.2.1. Do not apply the files yet.
trendz-app-deployment.yml:thingsboard/trendz:1.15.2.1trendz-python-executor-deployment.yml:thingsboard/trendz-python-executor:1.15.2.1
Stop Trendz
kubectl scale deployment trendz-app-deployment --replicas=0kubectl wait --for=delete pod -l app=trendz-app-pod-label --timeout=120sIf the pods are already gone, kubectl wait may print no matching resources found. This is expected.
Create the upgrade job
apiVersion: batch/v1kind: Jobmetadata: name: trendz-upgrade namespace: trendzspec: backoffLimit: 0 template: spec: restartPolicy: Never containers: - name: trendz-upgrade image: thingsboard/trendz:1.15.2.1 env: - name: UPGRADE_TRENDZ value: "true" envFrom: - configMapRef: name: trendz-app-db-config volumeMounts: - name: trendz-app-config mountPath: /trendz-config-files volumes: - name: trendz-app-config configMap: name: trendz-app-config items: - key: trendz.conf path: trendz.conf - key: logback.xml path: logback.xmlThe ConfigMap names, keys and namespace must match your trendz-app-deployment.yml. Installations created before 1.15 use the keys conf and logback.
Run the upgrade job
kubectl apply -f trendz-upgrade.ymlkubectl wait --for=condition=complete job/trendz-upgrade --timeout=900sVerify the upgrade
kubectl logs job/trendz-upgradeExpected output:
Start upgrading Trendz from version ……Current version is …, upgrade is not needed.Delete the job
kubectl delete job trendz-upgradeStart Trendz
kubectl apply -f trendz-python-executor-deployment.ymlkubectl apply -f trendz-app-deployment.ymlIf you run more than one pod, restore the replica count:
kubectl scale deployment trendz-app-deployment --replicas=<pod-count>Sync Trendz with ThingsBoard
After the upgrade, sync Trendz with ThingsBoard to update widgets and JS modules automatically. See the sync instructions for details.
Upgrading Trendz Analytics to 1.15.2
Update image versions
Set the image versions to 1.15.2. Do not apply the files yet.
trendz-app-deployment.yml:thingsboard/trendz:1.15.2trendz-python-executor-deployment.yml:thingsboard/trendz-python-executor:1.15.2
Stop Trendz
kubectl scale deployment trendz-app-deployment --replicas=0kubectl wait --for=delete pod -l app=trendz-app-pod-label --timeout=120sIf the pods are already gone, kubectl wait may print no matching resources found. This is expected.
Create the upgrade job
apiVersion: batch/v1kind: Jobmetadata: name: trendz-upgrade namespace: trendzspec: backoffLimit: 0 template: spec: restartPolicy: Never containers: - name: trendz-upgrade image: thingsboard/trendz:1.15.2 env: - name: UPGRADE_TRENDZ value: "true" envFrom: - configMapRef: name: trendz-app-db-config volumeMounts: - name: trendz-app-config mountPath: /trendz-config-files volumes: - name: trendz-app-config configMap: name: trendz-app-config items: - key: trendz.conf path: trendz.conf - key: logback.xml path: logback.xmlThe ConfigMap names, keys and namespace must match your trendz-app-deployment.yml. Installations created before 1.15 use the keys conf and logback.
Run the upgrade job
kubectl apply -f trendz-upgrade.ymlkubectl wait --for=condition=complete job/trendz-upgrade --timeout=900sVerify the upgrade
kubectl logs job/trendz-upgradeExpected output:
Start upgrading Trendz from version ……Current version is …, upgrade is not needed.Delete the job
kubectl delete job trendz-upgradeStart Trendz
kubectl apply -f trendz-python-executor-deployment.ymlkubectl apply -f trendz-app-deployment.ymlIf you run more than one pod, restore the replica count:
kubectl scale deployment trendz-app-deployment --replicas=<pod-count>Sync Trendz with ThingsBoard
After the upgrade, sync Trendz with ThingsBoard to update widgets and JS modules automatically. See the sync instructions for details.
Upgrading Trendz Analytics to 1.15.1.1 (latest 1.15.1 patch)
Update image versions
Set the image versions to 1.15.1.1. Do not apply the files yet.
trendz-app-deployment.yml:thingsboard/trendz:1.15.1.1trendz-python-executor-deployment.yml:thingsboard/trendz-python-executor:1.15.1.1
Stop Trendz
kubectl scale deployment trendz-app-deployment --replicas=0kubectl wait --for=delete pod -l app=trendz-app-pod-label --timeout=120sIf the pods are already gone, kubectl wait may print no matching resources found. This is expected.
Create the upgrade job
apiVersion: batch/v1kind: Jobmetadata: name: trendz-upgrade namespace: trendzspec: backoffLimit: 0 template: spec: restartPolicy: Never containers: - name: trendz-upgrade image: thingsboard/trendz:1.15.1.1 env: - name: UPGRADE_TRENDZ value: "true" envFrom: - configMapRef: name: trendz-app-db-config volumeMounts: - name: trendz-app-config mountPath: /trendz-config-files volumes: - name: trendz-app-config configMap: name: trendz-app-config items: - key: trendz.conf path: trendz.conf - key: logback.xml path: logback.xmlThe ConfigMap names, keys and namespace must match your trendz-app-deployment.yml. Installations created before 1.15 use the keys conf and logback.
Run the upgrade job
kubectl apply -f trendz-upgrade.ymlkubectl wait --for=condition=complete job/trendz-upgrade --timeout=900sVerify the upgrade
kubectl logs job/trendz-upgradeExpected output:
Start upgrading Trendz from version ……Current version is …, upgrade is not needed.Delete the job
kubectl delete job trendz-upgradeStart Trendz
kubectl apply -f trendz-python-executor-deployment.ymlkubectl apply -f trendz-app-deployment.ymlIf you run more than one pod, restore the replica count:
kubectl scale deployment trendz-app-deployment --replicas=<pod-count>Sync Trendz with ThingsBoard
After the upgrade, sync Trendz with ThingsBoard to update widgets and JS modules automatically. See the sync instructions for details.
Upgrading Trendz Analytics to 1.15.1
Update image versions
Set the image versions to 1.15.1. Do not apply the files yet.
trendz-app-deployment.yml:thingsboard/trendz:1.15.1trendz-python-executor-deployment.yml:thingsboard/trendz-python-executor:1.15.1
Stop Trendz
kubectl scale deployment trendz-app-deployment --replicas=0kubectl wait --for=delete pod -l app=trendz-app-pod-label --timeout=120sIf the pods are already gone, kubectl wait may print no matching resources found. This is expected.
Create the upgrade job
apiVersion: batch/v1kind: Jobmetadata: name: trendz-upgrade namespace: trendzspec: backoffLimit: 0 template: spec: restartPolicy: Never containers: - name: trendz-upgrade image: thingsboard/trendz:1.15.1 env: - name: UPGRADE_TRENDZ value: "true" envFrom: - configMapRef: name: trendz-app-db-config volumeMounts: - name: trendz-app-config mountPath: /trendz-config-files volumes: - name: trendz-app-config configMap: name: trendz-app-config items: - key: trendz.conf path: trendz.conf - key: logback.xml path: logback.xmlThe ConfigMap names, keys and namespace must match your trendz-app-deployment.yml. Installations created before 1.15 use the keys conf and logback.
Run the upgrade job
kubectl apply -f trendz-upgrade.ymlkubectl wait --for=condition=complete job/trendz-upgrade --timeout=900sVerify the upgrade
kubectl logs job/trendz-upgradeExpected output:
Start upgrading Trendz from version ……Current version is …, upgrade is not needed.Delete the job
kubectl delete job trendz-upgradeStart Trendz
kubectl apply -f trendz-python-executor-deployment.ymlkubectl apply -f trendz-app-deployment.ymlIf you run more than one pod, restore the replica count:
kubectl scale deployment trendz-app-deployment --replicas=<pod-count>Sync Trendz with ThingsBoard
After the upgrade, sync Trendz with ThingsBoard to update widgets and JS modules automatically. See the sync instructions for details.
Upgrading Trendz Analytics to 1.15.0.6 (latest 1.15.0 patch)
Update image versions
Set the image versions to 1.15.0.6. Do not apply the files yet.
trendz-app-deployment.yml:thingsboard/trendz:1.15.0.6trendz-python-executor-deployment.yml:thingsboard/trendz-python-executor:1.15.0.6
Stop Trendz
kubectl scale deployment trendz-app-deployment --replicas=0kubectl wait --for=delete pod -l app=trendz-app-pod-label --timeout=120sIf the pods are already gone, kubectl wait may print no matching resources found. This is expected.
Create the upgrade job
apiVersion: batch/v1kind: Jobmetadata: name: trendz-upgrade namespace: trendzspec: backoffLimit: 0 template: spec: restartPolicy: Never containers: - name: trendz-upgrade image: thingsboard/trendz:1.15.0.6 env: - name: UPGRADE_TRENDZ value: "true" envFrom: - configMapRef: name: trendz-app-db-config volumeMounts: - name: trendz-app-config mountPath: /trendz-config-files volumes: - name: trendz-app-config configMap: name: trendz-app-config items: - key: trendz.conf path: trendz.conf - key: logback.xml path: logback.xmlThe ConfigMap names, keys and namespace must match your trendz-app-deployment.yml. Installations created before 1.15 use the keys conf and logback.
Run the upgrade job
kubectl apply -f trendz-upgrade.ymlkubectl wait --for=condition=complete job/trendz-upgrade --timeout=900sVerify the upgrade
kubectl logs job/trendz-upgradeExpected output:
Start upgrading Trendz from version ……Current version is …, upgrade is not needed.Delete the job
kubectl delete job trendz-upgradeStart Trendz
kubectl apply -f trendz-python-executor-deployment.ymlkubectl apply -f trendz-app-deployment.ymlIf you run more than one pod, restore the replica count:
kubectl scale deployment trendz-app-deployment --replicas=<pod-count>Sync Trendz with ThingsBoard
After the upgrade, sync Trendz with ThingsBoard to update widgets and JS modules automatically. See the sync instructions for details.
Upgrading Trendz Analytics to 1.15.0.5 (latest 1.15.0 patch)
Update image versions
Set the image versions to 1.15.0.5. Do not apply the files yet.
trendz-app-deployment.yml:thingsboard/trendz:1.15.0.5trendz-python-executor-deployment.yml:thingsboard/trendz-python-executor:1.15.0.5
Stop Trendz
kubectl scale deployment trendz-app-deployment --replicas=0kubectl wait --for=delete pod -l app=trendz-app-pod-label --timeout=120sIf the pods are already gone, kubectl wait may print no matching resources found. This is expected.
Create the upgrade job
apiVersion: batch/v1kind: Jobmetadata: name: trendz-upgrade namespace: trendzspec: backoffLimit: 0 template: spec: restartPolicy: Never containers: - name: trendz-upgrade image: thingsboard/trendz:1.15.0.5 env: - name: UPGRADE_TRENDZ value: "true" envFrom: - configMapRef: name: trendz-app-db-config volumeMounts: - name: trendz-app-config mountPath: /trendz-config-files volumes: - name: trendz-app-config configMap: name: trendz-app-config items: - key: trendz.conf path: trendz.conf - key: logback.xml path: logback.xmlThe ConfigMap names, keys and namespace must match your trendz-app-deployment.yml. Installations created before 1.15 use the keys conf and logback.
Run the upgrade job
kubectl apply -f trendz-upgrade.ymlkubectl wait --for=condition=complete job/trendz-upgrade --timeout=900sVerify the upgrade
kubectl logs job/trendz-upgradeExpected output:
Start upgrading Trendz from version ……Current version is …, upgrade is not needed.Delete the job
kubectl delete job trendz-upgradeStart Trendz
kubectl apply -f trendz-python-executor-deployment.ymlkubectl apply -f trendz-app-deployment.ymlIf you run more than one pod, restore the replica count:
kubectl scale deployment trendz-app-deployment --replicas=<pod-count>Sync Trendz with ThingsBoard
After the upgrade, sync Trendz with ThingsBoard to update widgets and JS modules automatically. See the sync instructions for details.
Was this helpful?