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

# Upgrade Chronosphere Telemetry Pipeline

Upgrading the various components of Chronosphere Telemetry Pipeline gives you access
to the latest features, fixes, and improvements.

## Upgrade Core Operators and Core Instances

Use the information in this section to upgrade your
[Core Operators and Core Instances](/ingest/pipeline/v2/concepts#core-operators-and-core-instances).

<Note>
  You must use the same method for upgrading your Core Operators and Core Instances
  that you used when you originally installed them.
</Note>

### Determine your upgrade method

The method you must use for upgrading your Core Operator and Core Instance
depends on the method you used when you installed that Core Operator and Core
Instance, which in turn depends on your environment.

<Tabs>
  <Tab title="Kubernetes cluster" id="method-kubernetes">
    If you installed Telemetry Pipeline in a Kubernetes cluster and aren't sure
    whether you used Pipeline CLI or Helm during that installation process, run the
    following kubectl command:

    ```shell theme={null}
    kubectl -n calyptia get deploy calyptia-core-controller-manager --show-labels
    ```

    The resulting output shows any labels attached to the `controller-manager`
    resource.

    * If the label `app.kubernetes.io/managed-by=Helm` is present, that means you
      used Helm to install Telemetry Pipeline and should continue to use Helm for any
      subsequent upgrades to your Core Operator and Core Instance.
    * If the label `app.kubernetes.io/managed-by=Helm` is **not** present, that
      means you used Pipeline CLI to install Telemetry Pipeline and should continue to
      use Pipeline CLI for any subsequent upgrades to your Core Operator and Core Instance.
  </Tab>

  <Tab title="Linux" id="method-linux">
    Telemetry Pipeline supports only Pipeline CLI installation in Linux environments, and
    doesn't support Helm installation. If you installed Telemetry Pipeline in a Linux
    environment, continue to use Pipeline CLI for any subsequent upgrades to your Core
    Operator and Core Instance.
  </Tab>
</Tabs>

### Upgrade your Core Operator and Core Instance

After you [determine your upgrade method](#determine-your-upgrade-method), use
the corresponding steps to upgrade your Core Operator and Core Instance to the latest
available version.

<Tabs>
  <Tab title="Pipeline CLI" id="operator-upgrade-cli">
    If you deployed Telemetry Pipeline inside a Kubernetes cluster, Pipeline CLI must have
    access to that cluster. If you deployed Telemetry Pipeline on Linux, you must
    run Pipeline CLI from inside that Linux environment.

    1. [Update Pipeline CLI](/ingest/pipeline/pipeline-cli/install#update-pipeline-cli). Because
       Core Operator and Core Instance versions are dependent on your Pipeline CLI
       version, you must use the latest version of Pipeline CLI to perform upgrades.

    <Warning>
      If you don't update Pipeline CLI, subsequent steps will fail.
    </Warning>

    1. Run the following command to install the latest version of Core Operator, which
       overwrites any previously installed versions:

       ```shell theme={null}
       calyptia install operator
       ```

    2. Optional: Use the `--kube-namespace` flag to set the Core Operator's
       [namespace](/ingest/pipeline/v2/configure/kubernetes/namespaces).

    3. Run the following command to update your associated Core Instance:

       ```shell /INSTANCE/ theme={null}
       calyptia update core_instance operator INSTANCE
       ```

       Replace *`INSTANCE`* with the name of the Core Instance you want to update.
  </Tab>

  <Tab title="Helm" id="operator-upgrade-helm">
    1. Run the following command to upgrade the Telemetry Pipeline chart to the latest version:

       ```shell theme={null}
       helm repo update calyptia
       ```

    2. Run the following command to upgrade the custom resource definitions (CRDs) that
       Telemetry Pipeline relies on:

       ```shell theme={null}
       helm upgrade --install core-crd calyptia/core-crd
       ```

       To optionally set a custom registry for your Core Operator, add the flag
       `--set global.imageRegistry='NAME'` to this command. Replace *`NAME`* with
       the name of your custom registry.

    3. Run the following command to upgrade your Core Operator:

       ```shell theme={null}
       helm upgrade --install core-operator calyptia/core-operator -n calyptia
       ```

    4. Run the following command to upgrade your Core Instance:

       ```shell /INSTANCE/ theme={null}
       helm upgrade --install INSTANCE calyptia/core-instance -n calyptia
       ```

       Replace *`INSTANCE`* with the name of the Core Instance you want to update.
  </Tab>
</Tabs>

## Upgrade a pipeline

Regardless of [what method you used](#determine-your-upgrade-method) to install
and upgrade your Core Operator and Core Instance, you can use either the Telemetry
Pipeline web interface or [Pipeline CLI](/ingest/pipeline/pipeline-cli) to upgrade pipelines.

<Tabs>
  <Tab title="Web interface" id="pipeline-upgrade-ui">
    There are two possible methods for upgrading pipelines in the Telemetry Pipeline
    web interface.

    **Upgrade to the latest version**

    To upgrade a pipeline to the latest version, follow these steps:

    1. Sign in to [Telemetry Pipeline](https://core.calyptia.com/).
    2. Go to **Core Instances**, and then click the name of the pipeline you
       want to upgrade.
    3. If a pipeline isn't using the latest agent version, an `Upgrade to <version> available`
       notice is displayed on the [pipeline details](/ingest/pipeline/navigate#pipeline-details-v2-pipelines)
       page. Next to this notice, click **Upgrade** to upgrade the pipeline to the
       latest version.

    <Note>
      This upgrade method always retains a pipeline's current
      [agent image type](/ingest/pipeline/v2/configure/agent-image).
    </Note>

    **Choose the agent image type and version**

    To choose the [agent image type](/ingest/pipeline/v2/configure/agent-image) and version
    for your pipeline, follow these steps:

    1. Sign in to [Telemetry Pipeline](https://core.calyptia.com/).
    2. Go to **Core Instances**, and then click the name of the pipeline you
       want to upgrade.
    3. Go to <Icon icon="square-pen" /> **Advanced Settings**.
    4. In the **Pipeline Image** section, select an option from the **Version**
       drop-down menu. Version numbers with no suffix (for example, `1.2.3`) use the
       Red Hat UBI agent image, and version numbers with the distroless suffix (for
       example, `1.2.3-distroless`) use the distroless agent image.
    5. Click **Apply** to save your changes.
  </Tab>

  <Tab title="Pipeline CLI" id="pipeline-upgrade-cli">
    To upgrade an existing pipeline to the latest version, use the following command
    in Pipeline CLI:

    ```shell /PIPELINE/ /VERSION/ theme={null}
    calyptia update pipeline PIPELINE --image ghcr.io/calyptia/core/calyptia-fluent-bit:VERSION
    ```

    Replace the following:

    * *`PIPELINE`*: The name or [unique ID](/ingest/pipeline/v2/configure/metadata#get-pipeline-ids)
      of your pipeline.
    * *`VERSION`*: The latest version of the pipeline agent. You can find this value in the
      **Pipeline agent** column of the
      [Telemetry Pipeline component versions](/ingest/pipeline/v2/component-versions) table.
      For example, if the latest version of the pipeline agent is 1.23.0, provide the
      value `1.23.0` to use the Red Hat UBI [agent image](/ingest/pipeline/v2/configure/agent-image)
      or `1.23.0-distroless` to use the distroless agent image.
  </Tab>
</Tabs>

### Upgrade multiple pipelines

To upgrade all of your pipelines in a given environment simultaneously, run the
following command:

```shell theme={null}
curl -s https://raw.githubusercontent.com/chronosphereio/calyptia-cli/main/update-all-pipeline-images.sh | bash -s -- ghcr.io/calyptia/core/calyptia-fluent-bit:VERSION
```

Replace *`VERSION`* with the [latest version](/ingest/pipeline/v2/component-versions) of the
pipeline agent. You can find this value in the **Pipeline agent** column of the
[Telemetry Pipeline component versions](/ingest/pipeline/v2/component-versions) table.
For example, if the latest version of the pipeline agent is 1.23.0, provide the
value `1.23.0` to use the Red Hat UBI [agent image](/ingest/pipeline/v2/configure/agent-image)
or `1.23.0-distroless` to use the distroless agent image.

<Note>
  For critical pipelines, Chronosphere recommends updating each pipeline individually
  instead of using this script.
</Note>

### Deployment strategies

Deployment strategies govern how a pipeline's replicas behave during the upgrade
process. For more information, see the
[deployment strategies](/ingest/pipeline/v2/configure/deployment-strategies) guide.
