<a id="upgrade-cmf"></a>

# Upgrade Confluent Manager for Apache Flink

Flink applications are deployed in Confluent Platform with Confluent Manager for Apache Flink®, which is a
central management component that enables users to securely manage a fleet of Flink applications
across multiple environments. Use these instructions to upgrade earlier versions of Confluent Manager for Apache Flink (CMF) to a later version.
To install CMF, see [Install Confluent Manager for Apache Flink with Helm](helm.md#install-cmf-helm).

#### WARNING
Downgrades are not supported by CMF. Before upgrading, ensure you have tested
the new version in a non-production environment.

Follow these steps to upgrade CMF:

1. Scale down CMF to zero (0) pods and wait for the pod to be deleted.
   The following command shows an example of how to scale down CMF:
   ```bash
   kubectl scale deployment confluent-manager-for-apache-flink --replicas=0 -n <namespace>
   kubectl wait --for=delete pod -l app.kubernetes.io/name=confluent-manager-for-apache-flink --timeout=60s -n <namespace>
   ```
2. Uninstall the existing Flink Kubernetes Operator:
   ```bash
   helm uninstall cp-flink-kubernetes-operator -n <namespace>
   ```
3. Ensure certificate manager is installed, or use the following command to install it:
   ```bash
   kubectl create -f https://github.com/jetstack/cert-manager/releases/download/v1.18.2/cert-manager.yaml
   kubectl wait --for=condition=Available deployment -n cert-manager cert-manager-webhook --timeout=180s
   ```
4. Find the version Confluent Platform for Apache Flink Kubernetes operator you want to install.
   For a list of available versions, see the [Versions and Interoperability for Confluent Manager for Apache Flink](versions-interoperability.md#cmf-interop).
   ```bash
   helm repo add confluentinc https://packages.confluent.io/helm
   helm repo update confluentinc
   helm upgrade --install --version "<desired_version>" cp-flink-kubernetes-operator confluentinc/flink-kubernetes-operator
   ```
5. Upgrade CMF to the desired version using the Helm command:
   ```bash
   helm upgrade --install cmf confluentinc/confluent-manager-for-apache-flink --namespace <namespace> ...
   ```

#### IMPORTANT
If the CMF database is file system based, using `helm uninstall cmf` will
lead to the loss of the database because the Persistent Volume Claim (PVC) is managed by CMF.

## Related content

- [Install Confluent Manager for Apache Flink with Helm](helm.md#install-cmf-helm)
- [Install and Upgrade Confluent Manager for Apache Flink](overview.md#cpf-install)
- [Versions and Interoperability for Confluent Manager for Apache Flink](versions-interoperability.md#cmf-interop)
