Trendz Analytics Kubernetes 1.9.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 1
Connect to your Kubernetes cluster
Select the correct kube-config context before running any commands:
kubectl config get-contexts
kubectl config use-context <your-config-name>
Upgrading Trendz Analytics to 1.9.2-HF3
Reduce pods count
The deployment must have exactly one running pod for the upgrade to succeed:
kubectl scale deployment trendz-app-deployment --replicas=1
Create upgrade flag file
Get the current pod name:
kubectl get pods -l app=trendz-app-pod-label
Create the .upgradeversion flag file inside the pod, replacing <POD_NAME> with the name from the previous command. Set the version to the one you are currently running:
kubectl exec <POD_NAME> -- sh -c "echo '1.8.0' > /data/.upgradeversion"
Update image version
Open trendz-app-deployment.yml and update the image field to thingsboard/trendz:1.9.2-HF3:
nano trendz-app-deployment.yml
Apply the deployment
Apply the updated configuration and wait until the pod is ready:
kubectl apply -f trendz-app-deployment.yml
Verify the upgrade
Stream the pod logs to confirm the upgrade ran successfully:
kubectl logs -f <trendz-pod-name>
Look for the following lines:
Upgrading Trendz from version …
…
Current version is …, upgrade is not needed
…
Started TrendzApplication in …
Restore pods count
After the upgrade is complete, restore your preferred replica count:
kubectl scale deployment trendz-app-deployment --replicas=<pod-count>