Skip to content

Upgrading KX Insights

This section details the steps to upgrade the KX Insights Platform from a current install.

Preflight

Having the following information to hand will help smooth the process

variable example further details
RELEASE_NAME insights Install name
INSIGHTS_NAMESPACE kxi Namespace KX Insights deployed to
INSIGHTS_VERSION 1.1.1 Version of insights to install
OPERATOR_VERSION 1.1.0 Version of insights operator to install
INSTALL_CONFIG_FILE values.yaml Install configuration created on initial install
CUSTOM_ASSEMBLY sdk_sample_assembly.yaml Any assembly yamls deployed

Currently the upgrade process will require downtime to ensure data integrity can be guaranteed. This means that before any upgrade is scheduled, a number of pre-flight checks are necessary

  1. Stop ingestion feeds

    Stop all feeds into Insights to avoid data loss with inflight data.

  2. Ensure latest version of kxi-cli is installed

Upgrading Insights

The steps to upgrade KX Insights involves removing the current deployment and reinstalling the new version. This process does not remove the persisted data backing KX Insights configuration or databases. These remain as Persisted Volumes within the Kubernetes cluster.

Remove Assemblies

Assemblies are the dynamic data workflows within KX Insights. These are a Custom Resource (CR) deployed to the Kubernetes cluster. When upgrading KX Insights it is necessary to shutdown these data workflows.

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

Give time for resources to terminate and ensure all assemblies have been removed.

kubectl get asm -n $INSIGHTS_NAMESPACE

Remove KX Insights

The base KX Insights charts can be removed.

helm uninstall $RELEASE_NAME -n $INSIGHTS_NAMESPACE

Give time for resources to terminate and ensure no resources are running.

kubectl get pods -n $INSIGHTS_NAMESPACE

Remove KXI Operator

The KXI Operator is used to deploy the assemblies/data workflows.

Remove KXI Operator.

helm uninstall $RELEASE_NAME -n kxi-operator

Give time for resources to terminate and ensure no resources are running.

kubectl get pods -n kxi-operator

Remove KX Insights Assembly CRDs

A number of Custom Resource Definitions (CRDs) power KX Insights data workflows. These need to be upgraded along with KX Insights.

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

Assert there are no KX Insights CRDs present

kubectl get crds | grep insights.kx.com

Installing KX Insights

Now we have completed the removal of the KX Insights deploy, we can install it with the existing installation configuration.

Note

Before installing KX Insights, check the Upgrade Migrations for actions to perform before upgrading KX Insights.

Install Insights and KXI Operator

kxi install run --filepath $INSTALL_CONFIG_FILE --version $INSIGHTS_VERSION --operator-version $OPERATOR_VERSION

Check the system is running correctly.

  1. KXI Operator installed

    helm ls -n kxi-operator

    NAME        NAMESPACE       REVISION    UPDATED                                 STATUS      CHART                       APP VERSION
    insights    kxi-operator    1           2022-04-11 15:39:44.955236379 +0000 UTC deployed    kxi-operator-1.1.0          1.1.0
  2. KXI base charts installed

    helm ls -n $INSIGHTS_NAMESPACE

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

    kubectl get pods -n kxi-operator

    NAME                                     READY   STATUS    RESTARTS   AGE
    insights-kxi-operator-6df4bcfddc-gnnjj   1/1     Running   0          85m
    insights-kxi-operator-6df4bcfddc-lqmrl   1/1     Running   0          85m
    insights-kxi-operator-6df4bcfddc-z45wq   1/1     Running   0          85m
  4. KX Insights in running state

    kubectl get pods -n $INSIGHTS_NAMESPACE

    NAME                                            READY   STATUS      RESTARTS   AGE
    insights-aggregator-9959bdc87-4pg7z             2/2     Running     0          9m47s
    ...
    ...
    insights-sg-gateway-596b486d9f-pmhf4            1/1     Running     0          9m47s
    insights-sg-gateway-596b486d9f-qvzbr            1/1     Running     0          9m47s
  5. KXI Assembly CRDs 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 Assemblies

Assembly data workflows deployed from yaml configurations can then be deployed. For each $CUSTOM_ASSEMBLY, apply it to Kubernetes.

kubectl apply -f $CUSTOM_ASSEMBLY

Ensure assembly is up and running successfully

kubectl get asm

NAME                DESCRIPTION             READY   STATUS   AGE
sdk-assembly-data   SDK data assembly       True             2m2s