Docker and Kubernetes: Upgrading the Countly Application on the Kubernetes Platform

Follow

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.

Enterprise Edition Docker Images

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.

  1. Prior to upgrading Countly using a rolling update, verify the frontend and API deployments that require changes in their container image.
    kubectl get deployments
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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 upgrade_db.sh script in all the API Pods.

Example

If you upgrade from 19.08 to 20.11, then you should do the following after deploying the latest version using a rolling update.
Note: the upgrade_db.sh script should be executed in all the API Pods.

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/20.04/upgrade_db.sh
bash /opt/countly/bin/upgrade/20.11/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 Enterprise Edition, 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.
Was this article helpful?
0 out of 0 found this helpful

Looking for help?