# Upgrade Kloudfuse

## Upgrade command

1. Before performing an upgrade, validate that the upgrade won’t revert any customization on your cluster. See [Upgrade validation](https://docs.kloudfuse.com/platform/3.3.6/upgrade-validation/)

2. To check which Kloudfuse version you have, run the following command:

```console
helm list
```

3. Run the `upgrade` command.

```console
helm upgrade --install kfuse oci://us-east1-docker.pkg.dev/mvp-demo-301906/kfuse-helm/kfuse \
     -n kfuse \
     --version <VERSION> \
     -f custom-values.yaml
```

|     |     |
| --- | --- |
| **1** | `version`: Valid Kloudfuse release value; use the most recent one. |

## Upgrading to Latest Kloudfuse Releases

### 3.3.6

There are no specific pre-upgrade or post-upgrade steps for upgrading to the **Release 3.3.6**.

### 3.3.5

There are no specific pre-upgrade or post-upgrade steps for upgrading to the **Release 3.3.5**.

### 3.3.4

There are no specific pre-upgrade or post-upgrade steps for upgrading to the **Release 3.3.4**.

### 3.3.3

There are no specific pre-upgrade or post-upgrade steps for upgrading to the **Release 3.3.3**.

### 3.3.2

There are no specific pre-upgrade or post-upgrade steps for upgrading to the **Release 3.3.2**.

### 3.3.1

There are no specific post-upgrade steps for this release.

#### Pre-upgrade Steps

If your Kloudfuse configuration has RBAC enabled, you must also enable Audit Logs. Set both feature flags, `RBACEnabled` and `EnableAuditLogs`, to true in your yaml configuration file.

Set RBAC and Audit Logs feature flags

```code
global:
...
  RBACEnabled: true
  EnableAuditLogs: true
...
```

### 3.3.0

There are no specific post-upgrade steps for this release.

#### Pre-upgrade Steps

1. If your organization runs Kloudfuse on a shared cluster, or if it has the az-service enabled (it has taints and labels), update the following configuration in the `values.yaml` file before upgrading.

```code
config-mgmt-service:
     affinity:
       nodeAffinity:
         requiredDuringSchedulingIgnoredDuringExecution:
           nodeSelectorTerms:
        - matchExpressions:
          - key: ng_label
            operator: In
            values:
            - az1
tolerations:
  - key: "ng_taint"
    operator: "Equal"
    value: "az1"
    effect: "NoSchedule"
```

2. The configuration for label tracking is now part of the global section. If your organization tracks labels, move their definition to the `global` section.

### 3.2.5

There are no specific pre-upgrade or post-upgrade steps for upgrading to the **Release 3.2.5**.

### 3.2.4

There are no specific pre-upgrade or post-upgrade steps for upgrading to the **Release 3.2.4**.

### 3.2.3

There are no specific post-upgrade steps for this release.

#### Pre-upgrade

Scheduled Views

To support the new feature, [Scheduled Views](https://docs.kloudfuse.com/platform/3.3.6/release-notes/#fuseql-scheduled-views-3.2.3), ensure that your `global.kafkaTopics` section in the `custom-values.yaml` file contains the following code:

```text
        - name: kf_logs_views_topic
          partitions: 1
          replicationFactor: 1
```

RUM Applications

In this release, we added support for applications in RUM. See [Add and Manage Applications](https://docs.kloudfuse.com/platform/3.3.6/release-notes/#rum-3.2.3).

To successfully migrate existing RUM applications to the Kloudfuse platform, follow these steps during the Kloudfuse Kubernetes install. Alternatively, contact [Kloudfuse Support](https://docs.kloudfuse.com/platform/3.3.6/support/) for assistance.

1. Connect to the `configdb` pod:

```console
k exec -it kfuse-configdb-0 -- /bin/bash
PGPASSWORD=env | grep -i PASSWORD | cut -d'=' -f2 psql -U postgres
```

2. Connect to the `rumdb` table:

```console
\c rumdb
```

3. Insert the applications manually into the `db` from the config `yaml`:

```text
insert into applications (id, name, type, collect_client_ip, client_token) values ('app1_id', 'app1_name', 'app1_type', true/false, 'app1_auth_token'), ('app2_id', 'app2_name', 'app2_type', true/false, 'app2_auth_token);
```

### 3.2.2

We changed the backup disk type of the `kfuse-ssd` storage class for AWS from `io1` to `gp3`. Therefore, if you run Kloudfuse in AWS, you must make adjustments before upgrading to **Release 3.2.2**.

There are no specific post-upgrade steps for this release.

#### Pre-upgrade

Run the following command:

```console
kubectl delete storageclass kfuse-ssd
```

On new installs, any PV that you create using `kfuse-ssd` on AWS has a `gp3` type.

In existing installs, `kfuse-ssd` remains `io1`. You must manually change the corresponding backed EBS disk to `gp3`, in the AWS console.

### 3.2.1

There are no specific pre-upgrade or post-upgrade steps for upgrading to the **Release 3.2.1**.

### 3.2.0

There are no specific pre-upgrade steps for this release.

#### Post-upgrade

After the upgrade, restart pinot services:

```console
kubectl rollout restart sts pinot-broker pinot-controller pinot-server-realtime pinot-server-offline
```

This step takes care of the race condition related to raw index version change.

### 3.1.3

There are no specific pre-upgrade or post-upgrade steps for upgrading to the **Release 3.1.3**.

### 3.1.2

There are no specific post-upgrade steps for this release.

#### Pre-Upgrade

Before upgrading to **Release 3.1.2**, run the following command:

```console
kubectl delete deployments.apps catalog-service rulemanager advance-functions-service
```

### 3.1.0

#### Pre-Upgrade

Because of the fix for the labels and `labelselector` so some of our components can match the rest, you must run this command before upgrading to **Release 3.1.0**.

```console
kubectl delete deployments.apps catalog-service rulemanager advance-functions-service
```

#### Post-Upgrade

1. Restart Pinot Services

```console
kubectl rollout restart sts pinot-broker pinot-controller pinot-server-realtime pinot-server-offline
```

2. We moved hydration-service (HS) from a deployment to `statefulset`. You must manually delete the pod associated with it.

```console
kubectl delete pod hydration-service-<tag>
```

HS pod now runs under a custom pod name. Use the following clause to fetch it.

```console
(kubectl get pods | grep hydration-service)
```

### 2.7.4

#### Pre-Upgrade

For RBAC, before upgrading to **Release 2.7.4** from **Release 2.7.3**, check for a blank user row; click the **Admin** tab, and select **User Management**. The login and email fields are empty, and the record has a random id. Delete that row directly in the UI.

Alternatively, complete these steps in the console:

1. Run the `kfuse-postres.sh` script to enter the `configdb` shell.

```console
#!/usr/bin/env bash

# Optional parameters:
# 1. pod name - default kfuse-configdb-0
# 2. namespace - default kfuse
# 3. database name - default configdb

kubectl exec -it ${1:-kfuse-configdb-0} -n ${2:-kfuse} -- bash -c "PGPASSWORD=\
