> ## Documentation Index
> Fetch the complete documentation index at: https://docs.plerion.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Upgrade and rollback

> Upgrade Plerion's collector manager to a newer version or roll back to a previous release while preserving configuration.

## Discover new versions

Update your Helm repository to fetch the latest available chart versions:

```shell theme={"system"}
helm repo update
```

**Example output:**

```
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "plerion" chart repository
Update Complete. ⎈Happy Helming!⎈
```

List available versions of the collector manager chart:

```shell theme={"system"}
helm search repo plerion/collector-manager --versions
```

**Example output:**

```
NAME                        CHART VERSION APP VERSION DESCRIPTION
plerion/collector-manager   v1.1.0        v1.1.0      A Helm chart for Plerion Kubernetes Capabilities
plerion/collector-manager   v1.0.0        v1.0.0      A Helm chart for Plerion Kubernetes Capabilities
```

***

## Upgrade collector manager

Upgrade to a specific version while preserving existing configuration values:

```shell theme={"system"}
helm upgrade plerion-collector-manager plerion/collector-manager \
  --reuse-values \
  --version [version] \
  -n plerion-system
```

**Example output:**

```
Release "plerion-collector-manager" has been upgraded. Happy Helming!
NAME: plerion-collector-manager
LAST DEPLOYED: Mon Nov 20 19:26:30 2023
NAMESPACE: plerion-system
STATUS: deployed
REVISION: 2
```

### Command breakdown

* `plerion-collector-manager`: Name of the existing Helm release.
* `plerion/collector-manager`: Chart to upgrade.
* `--reuse-values`: Retain existing configuration during upgrade.
* `--version [version]`: Replace with the desired version.

***

## Rollback

Rolling back reverts to a previous, stable release if an upgrade causes issues.

### When to rollback

* **Unforeseen issues**: Updated release introduces errors or instability.
* **Compatibility concerns**: New version conflicts with other components.
* **Emergency recovery**: Critical issues disrupt the system.

## Rollback

Rolling back reverts to a previous, stable release if an upgrade causes issues.

### When to rollback

* **Unforeseen issues**: Updated release introduces errors or instability.
* **Compatibility concerns**: New version conflicts with other components.
* **Emergency recovery**: Critical issues disrupt the system.

### Steps to rollback

<Steps>
  <Step title="Check release history">
    Identify the revision you want to roll back to:

    ```shell theme={"system"}
    helm history -n plerion-system plerion-collector-manager
    ```

    **Example output:**

    ```
    REVISION UPDATED                  STATUS      CHART                      APP VERSION DESCRIPTION
    1        Tue Nov 20 12:18:00 2023 superseded  collector-manager-v1.0.0   v1.0.0      Install complete
    2        Wed Nov 21 09:00:35 2023 superseded  collector-manager-v1.0.0   v1.0.0      Upgrade complete
    3        Wed Nov 22 19:00:42 2023 deployed    collector-manager-v1.1.0   v1.1.0      Upgrade complete
    ```

    Note the revision number you want to roll back to.
  </Step>

  <Step title="Roll back to a previous revision">
    Run the following command, replacing `<REVISION_NUMBER>` with the revision identified above:

    ```shell theme={"system"}
    helm rollback -n plerion-system plerion-collector-manager <REVISION_NUMBER>
    ```

    **Example:**

    ```shell theme={"system"}
    helm rollback -n plerion-system plerion-collector-manager 2
    ```

    **Example output:**

    ```
    Rollback was a success! Happy Helming!
    ```
  </Step>

  <Step title="Verify rollback">
    After the rollback, confirm that the collector manager pods are running in a stable state:

    ```shell theme={"system"}
    kubectl get pods -n plerion-system
    ```

    Example output:

    ```
    NAME                                         READY   STATUS    RESTARTS   AGE
    plerion-collector-manager-ccbc55c5d-dr27w    1/1     Running   0          10m
    plerion-collector-manager-ccbc55c5d-x255n    1/1     Running   0          10m
    ```
  </Step>
</Steps>

***

## Troubleshooting

If rollback fails or issues persist, check Helm release status:

```shell theme={"system"}
helm status -n plerion-system plerion-collector-manager
```

Review the output for detailed errors and next steps.
