Upgrade Confluent for Kubernetes

Before you start the upgrade process, make sure your Kubernetes cluster is among the Supported Environments for the target version of Confluent for Kubernetes (CFK).

We recommend that you perform this upgrade separate from making other changes to your clusters, such as scaling up, changing configuration, or rotating credentials.

Upgrade notes

Before you start the upgrade process, review the following notes and make any necessary updates.

  • In all the Confluent Platform custom resources (CRs), set the Prometheus JMX exporter value factor rule to 1:

    spec:
      metrics:
        prometheus:
          rules:
            - valueFactor: 1
    

Upgrade Confluent for Kubernetes

To upgrade CFK:

  1. Disable resource reconciliation.

    To prevent Confluent Platform components from rolling restarts, temporarily disable resource reconciliation for each namespace where you have deployed the Confluent Platform component:

    1. Get the components’ custom resource (CR) kinds and names:

      kubectl get all --namespace <namespace> | grep platform.confluent.io
      

      The first column of the output contains the resource name in the format: <CR kind>/<CR name>.

      For example, in the following output, kafka.platform.confluent.io or shortly, kafka, is the CR kind, and kafka is the CR name:

      kafka.platform.confluent.io/kafka
      
    2. For each component listed in the previous step, disable the resource reconciliation:

      kubectl annotate <component CR kind> <component CR name> \
        platform.confluent.io/block-reconcile=true \
        --namespace <namespace>
      
  2. Add the CFK Helm repo:

    helm repo add confluentinc https://packages.confluent.io/helm
    
    helm repo update
    
  3. Get the CFK chart.

  4. Upgrade Confluent Platform custom resource definitions (CRDs):

    kubectl apply -f <CFK home>/confluent-for-kubernetes/crds/
    
  5. Upgrade CFK to 2.2.4.

    • If you deployed CFK using the values file, update the CFK image.tag to 0.304.72 in your values.yaml:

      image:
        tag: "0.304.72"
      

      And run the following command to upgrade CFK:

      helm upgrade --install confluent-operator \
        confluentinc/confluent-for-kubernetes \
        --values <path-to-values-file> \
        --namespace <namespace>
      
    • If you did not use a customized values.yaml for CFK deployment, run the following command to upgrade CFK:

      helm upgrade --install confluent-operator \
        confluentinc/confluent-for-kubernetes \
        --namespace <namespace>
      
  6. Alternatively, upgrade CFK to a specific version.

    • If you deployed CFK using the values file, in your values.yaml, update the CFK image.tag to the image tag of the CFK version specified in Confluent for Kubernetes image tags and versions:

      image:
        tag: "<CFK image tag>"
      

      And run the following command to upgrade CFK:

      helm upgrade --install confluent-operator \
        confluentinc/confluent-for-kubernetes \
        --values <path-to-values-file> \
        --namespace <namespace>
      
    • If you did not use a customized values.yaml for CFK deployment, run the following command to upgrade CFK to a specific version, using the image tag of the CFK version specified in Confluent for Kubernetes image tags and versions:

      helm upgrade --install confluent-operator \
        confluentinc/confluent-for-kubernetes \
        --version <CFK image tag>
        --namespace <namespace>
      
  7. Enable resource reconciliation for each Confluent Platform components that you disabled reconciliation in the first step above:

    kubectl annotate <component CR kind> <cluster name> \
      platform.confluent.io/block-reconcile- \
      --namespace <namespace>