Overview
Countly can be upgraded to the latest version by performing a rolling update of the images to the latest/desired version in both the frontend and API deployment files.
Rolling updates incrementally replace the application's Pods with new ones, which are then scheduled on nodes with available resources. Rolling updates ensure that your application remains up and available by incrementally updating Pods instances with new ones. Rolling updates are designed to update your workloads without downtime.
Please refer to the Images guide to get more details regarding the Docker images provided by Countly.
Upgrade Procedure
The procedure below is documented considering that Countly is being upgraded to 20.11.2.9, but it is applicable to any upgrade just the same when the respective changes are made to the commands provided.
-
Prior to upgrading Countly using a rolling update,verify the frontend and API deployments that require changes in their container image.
kubectl get deployments
-
The frontend Pod needs to be upgraded by performing a rolling update using the command below:
kubectl set image deployment countly-frontend-deployment countly-frontend=gcr.io/countly-01/frontend:21.11.1
The output will be similar to:
deployment.apps/countly-frontend-deployment
-
The API Pod needs to be upgraded by performing a rolling update using the command below:
kubectl set image deployment countly-api-deployment countly-api=gcr.io/countly-01/api:21.11.1
The output will be similar to:
deployment.apps/countly-api-deployment
- Verify the rollout status of both deployments using the command below:
kubectl rollout status deployment/countly-frontend-deployment
kubectl rollout status deployment/countly-frontend-deployment
- After performing the successful rollout update of both the deployments, you should be able to visualize the new Pods. You can verify this by using the command below:
kubectl get pods
- Run a post-installation script to verify the plugin installation. The script needs to be executed in all the API Pods and can be executed using the steps below:
First, authenticate into Shell of API Pods using the command below:kubectl exec -it pod/<api-pod name> -- /bin/bash
Second, execute the script using the command below:bash /opt/countly/bin/docker/postinstall.sh
Skipping Versions When Upgrading
In case you are running an older major version of Countly and you are about to upgrade to the latest major version, you will need to perform the steps shown below.
First, you need to deploy the latest release of Countly as described in the Upgrade Procedure above. Then, you need to run the upgrade_db.sh script in one of the API Pods.
You will need to run the upgrade_db.sh file for every version released between your current Countly version and the desired version. You can check the list of versions released on the `./bin/upgrade/` directory of our GitHub repository.
Example
If you upgrade from 22.03 to 22.09, you can see that we have 3 versions by checking the repository link mentioned above:
Then, authenticate into Shell of API Pods using the command below:
kubectl exec -it pod/<api-pod name> -- /bin/bash
And execute the script using the command below:
bash /opt/countly/bin/upgrade/22.06/upgrade_db.sh
bash /opt/countly/bin/upgrade/22.08/upgrade_db.sh
bash /opt/countly/bin/upgrade/22.09/upgrade_db.sh
Post-Upgrade Checklist
You can ensure that the upgrade was successful by going through the checklist below:
- Countly is accessible and the Overview page loads.
- New data is arriving in Overview, i.e., sessions or users metrics are increasing.
- For the Countly Enterprise, you can also check new data arriving in the user list in Users > User Profiles, i.e., you can see the latest changes affecting users.
- New data is arriving for the logs in Utilities > Request Logs, i.e. new request logs are coming in.