Skip to content

Upgrading KX Insights on Azure

To upgrade KX Insights you have to remove the current deployment and install the new version.

Note

This process does not remove the KX Insights configuration data or the databases.

Pre-requisites

When upgrading, all utilities such as the KXI CLI, Helm and Kubectl should be present on the administrators local machine.

  • Access to the Azure Portal
  • Access to the Kubernetes Cluster Overview
  • Access to Cloud Shell or Azure CLI
  • Access to the values.yaml file output from the deployment
  • Helm
  • Kubectl

Note

Currently the upgrade process will require downtime to ensure data integrity. This means that before any upgrade is scheduled the steps below must be taken.

Stop existing data ingestion

  • Tear down all pipelines by clicking the small 'X' next to each pipeline in the 'Pipelines' section of the Overview tab.

Removing the existing deployment

  • Connect to the Kubernetes Cluster.

    • On the Overview blade of the Kubernetes service resource, click on 'Connect’.

    • Connect to the cluster using either the Cloud Shell or the Azure CLI method and running the suggested commands.

  • Use the terminal window to execute the following commands:

    1. Remove any existing assemblies.

      sh kubectl get asm -o name -n $INSIGHTS_NAMESPACE | xargs -r kubectl delete

      Give time for resources to terminate and ensure assemblies have been removed. You can check whether they have been removed using the following command:

      sh kubectl get asm -n $INSIGHTS_NAMESPACE

    2. The base KX Insights charts can now be removed.

      helm delete $RELEASE_NAME -n $INSIGHTS_NAMESPACE

      Give time for resources to terminate. You can check whether they have terminated using the following command:

      kubectl get pods -n $INSIGHTS_NAMESPACE
    3. Remove KXI Operator.

      helm delete kxi-operator -n kxi-operator

      Give time for resources to terminate. You can check whether they have terminated using the following command:

      kubectl get pods -n kxi-operator
    4. Remove the CRDs that power KX Insights data workflows.

      kubectl delete crd assemblies.insights.kx.com
      kubectl delete crd assemblyresources.insights.kx.com

      Give time for CRDs to terminate. You can check whether the CRDs have terminated using the following command:

      kubectl get crds | grep insights.kx.com

Installing the KX Insights Platform

Now we've completely removed the KX Insights Platform deployment, we can install a new version with the existing installation configuration.

The values.yaml outputs can be located by navigating to the deployment outputs in Azure. This location is similar to the initial login stage where we collected the URLs to Keycloak and the Insights UI. Currently, access to this will last for one year.

  1. Download the values.yaml file from the KXI Config URL, this is displayed in the Outputs of the deployment as shown below.

    kxiConfigUrl

    wget -O values.yaml $kxiConfigUrl
  2. Download the yq command line utility.

    wget https://github.com/mikefarah/yq/releases/download/v4.25.2/yq_linux_amd64.tar.gz -O- -q | tar -zxf - -C /tmp 
    
    alias yq=/tmp/yq_linux_amd64
  3. Get the ACR URL from values.yaml.

    ACR_URL="oci://$(cd ~ | yq '.global.image.repository' values.yaml | cut -d '/' -f 1)"
  4. Install the KXI Operator.

    helm upgrade --install -f values.yaml kxi-operator ${ACR_URL}/kxi-operator -n kxi-operator --version=$kxiChartVersion
  5. Install the KX Insights Platform.

    helm upgrade --install -f values.yaml insights "${ACR_URL}/insights" --version "$kxiChartVersion

Checking the upgrade

Check the system is running correctly after the upgrade by taking the following steps:

  1. KXI Operator is installed:

    helm ls -n kxi-operator
    NAME NAMESPACE REVISION UPDATED
    STATUS CHART APP VERSION
    insights kxi-operator 1 2022-04-11 16:57:00.144126754
    +0000 UTC deployed kxi-operator 1.1.0 1.1.0
  2. KXI base charts is installed:

    helm ls -n kxi
    NAME NAMESPACE REVISION UPDATED
    STATUS CHART APP VERSION A
    insights kxi 1 2022-04-11 16:57:00.144126754
    +0000 UTC deployed insights 1.1.0 1.1.0
  3. KXI Operator is in a running state:

    kubectl get pods -n kxi-operator
    NAME AGE READY STATUS RESTARTS
    insights-aggregator-9959bdc87-4pg7z 85m 1/1 RUNNING 0
    insights-kxi-operator-6df4bcfddc-lqmrl 85m 1/1 RUNNING 0
    insights-kxi-operator-6df4bcfddc-z45wq 85m 1/1 RUNNING 0
  4. KX Insights is in a running state:

    kubectl get pods -n kxi
    NAME AGE READY STATUS
    insights-aggregator-9959bdc87-4pg7z 9m47s 2/2 RUNNING
    insights-sg-gateway-596b486d9f-pmhf4 9m47s 1/1 RUNNING
    insights-sg-gateway-596b486d9f-qvzbr 9m47s 1/1 RUNNING
  5. KXI Assembly CRDs have redeployed:

    kubectl get crds | grep insights.kx.com
    assemblies.insights.kx.com 2022-04-11T15:23:53Z
    assemblyresources.insights.kx.com 2022-04-11T15:23:54Z

Redeploy existing assemblies

Assemblies deployed from yaml configurations can now be deployed.

For each assembly take the following actions:

  1. Redeploy the assembly.

    kubectl apply -f $CUSTOM_ASSEMBLY
  2. Check the assembly is up and running successfully.

    kubectl get asm
    NAME DESCRIPTION READY STATUS AGE
    sdk-assembly-data SDK data assembly TRUE 2m2s