# Upgrade Redpanda in Kubernetes

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [streaming-full.txt](https://docs.redpanda.com/streaming-full.txt)

---
title: Upgrade Redpanda in Kubernetes
latest-operator-version: v26.1.4
# EOL = End-of-Life (support lifecycle status)
page-is-nearing-eol: "false"
page-is-past-eol: "true"
page-eol-date: December 22, 2024
latest-console-tag: v3.7.3
latest-connect-version: 4.93.0
docname: k-rolling-upgrade
page-component-name: streaming
page-version: "23.3"
page-component-version: "23.3"
page-component-title: Streaming
page-relative-src-path: k-rolling-upgrade.adoc
page-edit-url: https://github.com/redpanda-data/docs/edit/v/23.3/modules/upgrade/pages/k-rolling-upgrade.adoc
description: To benefit from Redpanda's new features and enhancements, upgrade to the latest version.
page-git-created-date: "2023-08-04"
page-git-modified-date: "2024-04-08"
support-status: past end-of-life
---

<!-- Source: https://docs.redpanda.com/streaming/23.3/upgrade/k-rolling-upgrade.md -->

To benefit from Redpanda’s new features and enhancements, upgrade to the latest version. New features are available after all brokers in the cluster are upgraded and restarted.

Redpanda platform version numbers follow the convention AB.C.D, where AB is the two digit year, C is the feature release, and D is the patch release. For example, version 22.3.1 indicates the first patch release on the third feature release of the year 2022. Patch releases include bug fixes and minor improvements, with no change to user-facing behavior. New and enhanced features are documented with each feature release. You can find a list of all releases on [GitHub](https://github.com/redpanda-data/redpanda/releases).

## [](#limitations)Limitations

The following limitations ensure a smooth transition between versions and help to maintain the stability of your cluster.

-   **Broker upgrades**:

    -   New features are enabled only after upgrading all brokers in the cluster.

    -   You can upgrade only one feature release at a time, for example from 22.2 to 22.3. Skipping feature releases is not supported.


-   **Rollbacks**: You can roll back to the original version only if at least one broker is still running the original version (not yet upgraded) and the cluster hasn’t yet restarted.

-   **Downgrades**: Downgrades are possible only between patch releases of the same feature release. For example, you can downgrade from 22.2.2 to 22.2.1. Downgrading to previous feature releases, such as 22.1.x, is not supported.

-   **Tiered Storage**: If you have [Tiered Storage](https://docs.redpanda.com/streaming/23.3/manage/tiered-storage/) enabled and you’re upgrading to 23.2, object storage uploads are paused until all brokers are upgraded. If the cluster cannot upgrade, roll it back to the original version.

    > ⚠️ **CAUTION**
    >
    > In a mixed-version state, the cluster could run out of disk space. If you need to force a mixed-version cluster to upload, transfer partition leadership to brokers running the original version.

-   **Remote Read Replicas**: Upgrade the Remote Read Replica cluster first, ensuring it’s on the same version as the origin cluster or one feature release ahead of the origin cluster. When upgrading to Redpanda 23.2, metadata from object storage is not synchronized until all brokers in the cluster are upgraded. If you need to force a mixed-version cluster to sync read replicas, transfer partition leadership to brokers running the original version.

-   **Controller snapshots**: [Controller snapshots](https://docs.redpanda.com/streaming/23.3/get-started/architecture/#controller-partition-and-snapshots) are disabled in upgraded clusters. To re-enable them, contact [Redpanda Support](https://support.redpanda.com/hc/en-us).


## [](#prerequisites)Prerequisites

-   [A Redpanda cluster running in Kubernetes](https://docs.redpanda.com/streaming/23.3/deploy/deployment-option/self-hosted/kubernetes/).

-   The default [RollingUpdate strategy](https://docs.redpanda.com/streaming/23.3/reference/k-redpanda-helm-spec/#statefulset-updatestrategy-type) configured in the Helm values.

-   Review the [Kubernetes Compatibility](https://docs.redpanda.com/streaming/23.3/upgrade/k-compatibility/) topic.

-   [jq](https://stedolan.github.io/jq/download/) for listing available versions.


## [](#impact-of-broker-restarts)Impact of broker restarts

When brokers restart, clients may experience higher latency, nodes may experience CPU spikes when the broker becomes available again, and you may receive alerts about under-replicated partitions. Topics that weren’t using replication (that is, topics that had `replication.factor=1`) will be unavailable.

### [](#temporary-increase-in-latency-on-clients-producers-and-consumers)Temporary increase in latency on clients (producers and consumers)

When you restart one or more brokers in a cluster, clients (consumers and producers) may experience higher latency due to partition leadership reassignment. Because clients must communicate with the leader of a partition, they may send a request to a broker whose leadership has been transferred, and receive `NOT_LEADER_FOR_PARTITION`. In this case, clients must request metadata from the cluster to find out the address of the new leader. Clients refresh their metadata periodically, or when the client receives some retryable errors that indicate that the metadata may be stale. For example:

1.  Broker A shuts down.

2.  Client sends a request to broker A, and receives `NOT_LEADER_FOR_PARTITION`.

3.  Client requests metadata, and learns that the new leader is broker B.

4.  Client sends the request to broker B.


### [](#cpu-spikes-upon-broker-restart)CPU spikes upon broker restart

When a restarted broker becomes available again, you may see your nodes' CPU usage increase temporarily. This temporary increase in CPU usage is due to the cluster rebalancing the partition replicas.

### [](#under-replicated-partitions)Under-replicated partitions

When a broker is in maintenance mode, Redpanda continues to replicate updates to that broker. When a broker is taken offline during a restart, partitions with replicas on the broker could become out of sync until it is brought back online. Once the broker is available again, data is copied to its under-replicated replicas until all affected partitions are in sync with the partition leader.

## [](#incompatible-changes)Incompatible changes

Patch releases in [22.3.14](https://github.com/redpanda-data/redpanda/discussions/9522) and [23.1.2](https://github.com/redpanda-data/redpanda/discussions/9523) changed the behavior when remote read is disabled and the requested Raft term falls below the local log’s beginning. In earlier versions, Redpanda returned an offset -1. With the patch, when you request a value older than the lowest offset, Redpanda returns the lowest offset, not -1.

## [](#find-a-new-version)Find a new version

Before you perform a rolling upgrade, you must find out:

-   Which Redpanda version you are currently running.

-   Whether you can upgrade directly to the new version.

-   What’s changed since your original version.


1.  Find your current version of Redpanda:

    ```bash
    kubectl exec <pod-name> --namespace <namespace> -c redpanda -- \
      rpk redpanda admin brokers list
    ```

    For all available flags, see the [`rpk redpanda admin brokers list` command reference](https://docs.redpanda.com/streaming/23.3/reference/rpk/rpk-redpanda/rpk-redpanda-admin-brokers-list/).

    Expected output:

    The Redpanda version for each broker is listed under `BROKER-VERSION`.

    ```none
    NODE-ID  BROKER-VERSION
    0        v22.2.10
    1        v22.2.10
    2        v22.2.10
    ```

2.  Find the Redpanda version that’s used in the latest version of the Redpanda Helm chart:

    ```bash
    helm repo update && \
    helm show chart redpanda/redpanda | grep appVersion
    ```

    Example output:

    appVersion:	v22.2.10

    > 📝 **NOTE**
    >
    > If your current version is more than one feature release behind the version in the latest Redpanda Helm chart, you must first upgrade to an intermediate version. To list all available versions:
    >
    > ```bash
    > curl -s 's://hub.docker.com/v2/repositories/redpandadata/redpanda/tags/?ordering=last_updated&page=1&page_size=50' | jq -r '.results[].name'
    > ```

3.  Check the [release notes](https://github.com/redpanda-data/redpanda/releases) to find information about what has changed between Redpanda versions.


## [](#operator)Upgrade the Redpanda Operator

This section provides guidance on upgrading the Redpanda Operator. If you do not use the Redpanda Operator to manage your clusters, you can [skip this section](#upgrade).

When a new version of the Redpanda Helm chart is released, you must assess its compatibility with the current Redpanda Operator. Changes in the Redpanda Helm chart, especially modifications to the values file, may introduce new features or configuration options that the Redpanda Operator should be aware of.

1.  [Review the release notes](https://github.com/redpanda-data/helm-charts/releases) of the Redpanda Helm chart to understand the nature of the changes and their potential impact on your Redpanda clusters.

2.  Determine if the current version of the Redpanda Operator is compatible with the new Redpanda Helm chart version. Not all changes in the Redpanda Helm chart require an upgrade of the Redpanda Operator. See [Kubernetes Compatibility](https://docs.redpanda.com/streaming/23.3/upgrade/k-compatibility/).


If the new Redpanda Helm chart version introduces significant changes that affect how the Redpanda Operator manages the Redpanda clusters:

-   Upgrade the CRDs to match the latest version of the Redpanda Operator.

    ```bash
    kubectl kustomize "https://github.com/redpanda-data/redpanda-operator//src/go/k8s/config/crd?ref=v26.1.4" \
        | kubectl apply -f -
    ```

    This step ensures that the Redpanda Operator can correctly interpret and manage the configurations defined in the Redpanda resource.

-   Ensure you are using the latest version of the Redpanda Operator that supports the new Redpanda Helm chart version.

    ```bash
    helm repo add redpanda https://charts.redpanda.com
    helm upgrade --install redpanda-controller redpanda/operator \
      --namespace <namespace> \
      --set image.tag=v26.1.4
    ```

    > ⚠️ **CAUTION**
    >
    > Make sure to include all existing overrides, otherwise the upgrade may fail.


## [](#upgrade)Perform a rolling upgrade

A rolling upgrade involves updating the version of Redpanda in the Redpanda Helm chart, which triggers a rolling restart.

> 📝 **NOTE**
>
> The Helm chart’s `preStop` lifecycle hook puts each broker into maintenance mode before the Pod is terminated. If maintenance mode does not complete before the `terminationGracePeriod` the container is forcefully terminated using a `SIGKILL` command.
>
> The default `terminationGracePeriod` is 90 seconds, which should be long enough for large clusters. You can test different values in a development environment. To configure the `terminationGracePeriod`, use the [`statefulset.terminationGracePeriodSeconds`](https://docs.redpanda.com/streaming/23.3/reference/k-redpanda-helm-spec/#statefulsetterminationgraceperiodseconds) setting.

To upgrade:

1.  Check for topics that have a replication factor greater than one.

    If you have topics with a replication factor of 1, and if you have sufficient disk space, temporarily [increase the replication factor](https://docs.redpanda.com/streaming/23.3/upgrade/migrate/data-migration/#change-topic-replication-factor) to limit outages for these topics during the rolling upgrade.

    Increase the replication factor before you upgrade to ensure that Redpanda has time to replicate data to other brokers.

2.  Ensure that the cluster is healthy:

    ```bash
    kubectl exec <pod-name> --namespace <namespace> -c redpanda -- \
      rpk cluster health
    ```

    The draining process won’t start until the cluster is healthy.

    Example output:

    CLUSTER HEALTH OVERVIEW
    =======================
    Healthy:                     true **(1)**
    Controller ID:               0
    All nodes:                   \[0 1 2\] **(2)**
    Nodes down:                  \[\] **(3)**
    Leaderless partitions:       \[\] **(3)**
    Under-replicated partitions: \[\] **(3)**

    | 1 | The cluster is either healthy (true) or unhealthy (false). |
    | --- | --- |
    | 2 | The node IDs of all brokers in the cluster. |
    | 3 | These fields contain data only when the cluster is unhealthy. |

3.  If you’re using the Redpanda Helm chart without the Redpanda Operator, list all your existing overrides of the Helm values:

    ```bash
    helm get values redpanda --namespace <namespace>
    ```

    You’ll need to apply these overrides in the next step.

4.  Upgrade the Redpanda version by overriding the `image.tag` setting. Replace `<new-version>` with a valid version tag.

    ### Helm + Operator

    `redpanda-cluster.yaml`

    ```yaml
    apiVersion: cluster.redpanda.com/v1alpha1
    kind: Redpanda
    metadata:
      name: redpanda
    spec:
      chartRef: {}
      clusterSpec:
        image:
          tag: <new-version>
    ```

    ```bash
    kubectl apply -f redpanda-cluster.yaml --namespace <namespace>
    ```


    ### Helm


    #### --values

    `redpanda-version.yaml`

    ```yaml
    image:
      tag: <new-version>
    ```

    ```bash
    helm upgrade --install redpanda redpanda/redpanda --namespace <namespace> --create-namespace \
    --values redpanda-version.yaml --reuse-values
    ```


    #### --set

    ```bash
    helm upgrade --install redpanda redpanda/redpanda --namespace <namespace> --create-namespace \
      --set image.tag=<new-version>
    ```

    > ⚠️ **CAUTION**
    >
    > Make sure to include all existing overrides, otherwise the upgrade may fail. For example, if you already enabled SASL, include the same SASL overrides. Do not use the `--reuse-values` flag, otherwise Helm won’t include any new values from the upgraded chart.

5.  Wait for the Pods to be terminated and recreated with the new version of Redpanda.

    ```bash
    kubectl get pod --namespace <namespace> --watch
    ```

    Each Pod in the StatefulSet is terminated one at a time, starting from the one with the highest ordinal.

    Example output

    NAME                                    READY   STATUS
    redpanda-controller-operator            2/2     Running
    redpanda-0                              2/2     Running
    redpanda-1                              2/2     Running
    redpanda-2                              0/2     Init:0/3
    redpanda-configuration-88npt            0/1     Completed
    redpanda-console-7cf85cf87f-rmtnj       1/1     Running
    redpanda-post-upgrade-ljqpr             0/1     Completed

6.  When all of the Pods are ready and have a `Running` status, verify that the brokers are now running the upgraded version of Redpanda:

    ```bash
    kubectl exec <pod-name> --namespace <namespace> -c redpanda -- \
      rpk redpanda admin brokers list
    ```


## [](#rollbacks)Rollbacks

If something does not go as planned during a rolling upgrade, you can roll back to the original version as long as you have not upgraded all brokers.

> 📝 **NOTE**
>
> The Redpanda Operator rolls back automatically after three failed attempts to upgrade the cluster.

If you are using the Redpanda Helm chart without the Redpanda Operator, you can roll back manually.

The StatefulSet uses the `RollingUpdate` strategy by default in [`statefulset.updateStrategy.type`](https://docs.redpanda.com/streaming/23.3/reference/k-redpanda-helm-spec/#statefulsetupdatestrategytype), which means all Pods in the StatefulSet are restarted in reverse-ordinal order. For details, see the [Kubernetes documentation](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies).

1.  Find the previous revision:

    ```bash
    helm history redpanda --namespace <namespace>
    ```

    Example output

    REVISION	UPDATED                 	STATUS    	CHART          	APP VERSION	DESCRIPTION
    1       	Fri Mar  3 15:16:24 year	superseded	redpanda-2.12.2	v22.3.13   	Install complete
    2       	Fri Mar  3 15:19:41 year	deployed	  redpanda-2.12.2	v22.3.13   	Upgrade complete

2.  Roll back to the previous revision:

    ```bash
    helm rollback redpanda <previous-revision> --namespace <namespace>
    ```

3.  Verify that the cluster is healthy. If the cluster is unhealthy, the upgrade may still be in progress. The command exits when the cluster is healthy.

    ```bash
    kubectl exec <pod-name> --namespace <namespace> -c redpanda -- \
      rpk cluster health \
      --watch --exit-when-healthy
    ```

    Example output:

    ```none
    CLUSTER HEALTH OVERVIEW
    =======================
    Healthy:               true
    Controller ID:         1
    All nodes:             [2,1,0]
    Nodes down:            []
    Leaderless partitions: []
    ```


## [](#troubleshooting)Troubleshooting

### [](#helmrelease-is-not-ready)HelmRelease is not ready

If you are using the Redpanda Operator, you may see the following message while waiting for a Redpanda custom resource to be deployed:

```bash
NAME       READY   STATUS
redpanda   False   HelmRepository 'redpanda/redpanda-repository' is not ready
redpanda   False   HelmRelease 'redpanda/redpanda' is not ready
```

While the deployment process can sometimes take a few minutes, a prolonged 'not ready' status may indicate an issue. Follow the steps below to investigate:

1.  Check the status of the HelmRelease:

    ```bash
    kubectl describe helmrelease <redpanda-resource-name> --namespace <namespace>
    ```

2.  Review the Redpanda Operator logs:

    ```bash
    kubectl logs -l app.kubernetes.io/name=operator -c manager --namespace <namespace>
    ```


### [](#helmrelease-retries-exhausted)HelmRelease retries exhausted

The `HelmRelease retries exhausted` error occurs when the Helm Controller has tried to reconcile the HelmRelease a number of times, but these attempts have failed consistently.

The Helm Controller watches for changes in HelmRelease objects. When changes are detected, it tries to reconcile the state defined in the HelmRelease with the state in the cluster. The process of reconciliation includes installation, upgrade, testing, rollback or uninstallation of Helm releases.

You may see this error due to:

-   Incorrect configuration in the HelmRelease.

-   Issues with the chart, such as a non-existent chart version or the chart repository not being accessible.

-   Missing dependencies or prerequisites required by the chart.

-   Issues with the underlying Kubernetes cluster, such as insufficient resources or connectivity issues.


To debug this error do the following:

1.  Check the status of the HelmRelease:

    ```bash
    kubectl describe helmrelease <cluster-name> --namespace <namespace>
    ```

2.  Review the Redpanda Operator logs:

    ```bash
    kubectl logs -l app.kubernetes.io/name=operator -c manager --namespace <namespace>
    ```


When you find and fix the error, you must use the Flux CLI, `fluxctl`, to suspend and resume the reconciliation process:

1.  [Install Flux CLI](https://fluxcd.io/flux/installation/#install-the-flux-cli).

2.  Suspend the HelmRelease:

    ```bash
    flux suspend helmrelease <cluster-name> --namespace <namespace>
    ```

3.  Resume the HelmRelease:

    ```bash
    flux resume helmrelease <cluster-name> --namespace <namespace>
    ```


### [](#crash-loop-backoffs)Crash loop backoffs

If a broker crashes after startup, or gets stuck in a crash loop, it could produce progressively more stored state that uses additional disk space and takes more time for each restart to process.

To prevent infinite crash loops, the Redpanda Helm chart sets the `crash_loop_limit` node property to 5. The crash loop limit is the number of consecutive crashes that can happen within one hour of each other. After Redpanda reaches this limit, it will not start until its internal consecutive crash counter is reset to zero. In Kubernetes, the Pod running Redpanda remains in a `CrashLoopBackoff` state until its internal consecutive crash counter is reset to zero.

To troubleshoot a crash loop backoff:

1.  Check the Redpanda logs from the most recent crashes:

    ```bash
    kubectl logs <pod-name> --namespace <namespace>
    ```

    > 📝 **NOTE**
    >
    > Kubernetes retains logs only for the current and the previous instance of a container. This limitation makes it difficult to access logs from earlier crashes, which may contain vital clues about the root cause of the issue. Given these log retention limitations, setting up a centralized logging system is crucial. Systems such as [Loki](https://grafana.com/docs/loki/latest/) or [Datadog](https://www.datadoghq.com/product/log-management/) can capture and store logs from all containers, ensuring you have access to historical data.

2.  Resolve the issue that led to the crash loop backoff.

3.  Reset the crash counter to zero to allow Redpanda to restart. You can do any of the following to reset the counter:

    -   Update the redpanda.yaml configuration file. You can make changes to any of the following sections in the Redpanda Helm chart to trigger an update:

        -   `config.cluster`

        -   `config.node`

        -   `config.tunable`


    -   Delete the `startup_log` file in the broker’s data directory.

        ```bash
        kubectl exec <pod-name> --namespace <namespace> -- rm /var/lib/redpanda/data/startup_log
        ```

        > 📝 **NOTE**
        >
        > It might be challenging to execute this command within a Pod that is in a `CrashLoopBackoff` state due to the limited time during which the Pod is available before it restarts. Wrapping the command in a loop might work.

    -   Wait one hour since the last crash. The crash counter resets after one hour.



To avoid future crash loop backoffs and manage the accumulation of small segments effectively:

-   [Monitor](https://docs.redpanda.com/streaming/23.3/manage/kubernetes/monitoring/k-monitor-redpanda/) the size and number of segments regularly.

-   Optimize your Redpanda configuration for segment management.

-   Consider implementing [Tiered Storage](https://docs.redpanda.com/streaming/23.3/manage/kubernetes/storage/tiered-storage/k-tiered-storage/) to manage data more efficiently.


### [](#statefulset-never-rolls-out)StatefulSet never rolls out

If the StatefulSet Pods remain in a pending state, they are waiting for resources to become available.

To identify the Pods that are pending, use the following command:

```bash
kubectl get pod --namespace <namespace>
```

The response includes a list of Pods in the StatefulSet and their status.

To view logs for a specific Pod, use the following command.

```bash
kubectl logs -f <pod-name> --namespace <namespace>
```

You can use the output to debug your deployment.

### [](#unable-to-mount-volume)Unable to mount volume

If you see volume mounting errors in the Pod events or in the Redpanda logs, ensure that each of your Pods has a volume available in which to store data.

-   If you’re using StorageClasses with dynamic provisioners (default), ensure they exist:

    ```bash
    kubectl get storageclass
    ```

-   If you’re using PersistentVolumes, ensure that you have one PersistentVolume available for each Redpanda broker, and that each one has the storage capacity that’s set in `storage.persistentVolume.size`:

    ```bash
    kubectl get persistentvolume --namespace <namespace>
    ```


To learn how to configure different storage volumes, see [Configure Storage](https://docs.redpanda.com/streaming/23.3/manage/kubernetes/storage/k-configure-storage/).

### [](#failed-to-pull-image)Failed to pull image

When deploying the Redpanda Helm chart, you may encounter Docker rate limit issues because the default registry URL is not recognized as a Docker Hub URL. The domain `docker.redpanda.com` is used for statistical purposes, such as tracking the number of downloads. It mirrors Docker Hub’s content while providing specific analytics for Redpanda.

Failed to pull image "docker.redpanda.com/redpandadata/redpanda:v<version>": rpc error: code = Unknown desc = failed to pull and unpack image "docker.redpanda.com/redpandadata/redpanda:v<version>": failed to copy: httpReadSeeker: failed open: unexpected status code 429 Too Many Requests - Server message: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit

To fix this error, do one of the following:

-   Replace the `image.repository` value in the Helm chart with `docker.io/redpandadata/redpanda`. Switching to Docker Hub avoids the rate limit issues associated with `docker.redpanda.com`.

    #### Helm + Operator

    `redpanda-cluster.yaml`

    ```yaml
    apiVersion: cluster.redpanda.com/v1alpha1
    kind: Redpanda
    metadata:
      name: redpanda
    spec:
      chartRef: {}
      clusterSpec:
        image:
          repository: docker.io/redpandadata/redpanda
    ```

    ```bash
    kubectl apply -f redpanda-cluster.yaml --namespace <namespace>
    ```


    #### Helm


    ##### --values

    `docker-repo.yaml`

    ```yaml
    image:
      repository: docker.io/redpandadata/redpanda
    ```

    ```bash
    helm upgrade --install redpanda redpanda/redpanda --namespace <namespace> --create-namespace \
      --values docker-repo.yaml --reuse-values
    ```


    ##### --set

    ```bash
    helm upgrade --install redpanda redpanda/redpanda --namespace <namespace> --create-namespace \
      --set image.repository=docker.io/redpandadata/redpanda
    ```

-   Authenticate to Docker Hub by logging in with your Docker Hub credentials. The `docker.redpanda.com` site acts as a reflector for Docker Hub. As a result, when you log in with your Docker Hub credentials, you will bypass the rate limit issues.


### [](#dig-not-defined)Dig not defined

This error means that you are using an unsupported version of [Helm](https://helm.sh/docs/intro/install/):

Error: parse error at (redpanda/templates/statefulset.yaml:203): function "dig" not defined

To fix this error, ensure that you are using the minimum required version: 3.10.0.

```bash
helm version
```

### [](#repository-name-already-exists)Repository name already exists

If you see this error, remove the `redpanda` chart repository, then try installing it again.

```bash
helm repo remove redpanda
helm repo add redpanda https://charts.redpanda.com
helm repo update
```

### [](#fatal-error-during-checker-data-directory-is-writable-execution)Fatal error during checker "Data directory is writable" execution

This error appears when Redpanda does not have write access to your configured storage volume under `storage` in the Helm chart.

Error: fatal error during checker "Data directory is writable" execution: open /var/lib/redpanda/data/test\_file: permission denied

To fix this error, set `statefulset.initContainers.setDataDirOwnership.enabled` to `true` so that the initContainer can set the correct permissions on the data directories.

### [](#cannot-patch-redpanda-with-kind-statefulset)Cannot patch "redpanda" with kind StatefulSet

This error appears when you run `helm upgrade` with the `--values` flag but do not include all your previous overrides.

Error: UPGRADE FAILED: cannot patch "redpanda" with kind StatefulSet: StatefulSet.apps "redpanda" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden

To fix this error, do one of the following:

-   Include all the value overrides from the previous installation or upgrade using either the `--set` or the `--values` flags.

-   Use the `--reuse-values` flag.

    > ⚠️ **WARNING**
    >
    > Do not use the `--reuse-values` flag to upgrade from one version of the Helm chart to another. This flag stops Helm from using any new values in the upgraded chart.


### [](#cannot-patch-redpanda-console-with-kind-deployment)Cannot patch "redpanda-console" with kind Deployment

This error appears if you try to upgrade your deployment and you already have `console.enabled` set to `true`.

Error: UPGRADE FAILED: cannot patch "redpanda-console" with kind Deployment: Deployment.apps "redpanda-console" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map\[string\]string{"app.kubernetes.io/instance":"redpanda", "app.kubernetes.io/name":"console"}, MatchExpressions:\[\]v1.LabelSelectorRequirement(nil)}: field is immutable

To fix this error, set `console.enabled` to `false` so that Helm doesn’t try to deploy Redpanda Console again.

### [](#helm-is-in-a-pending-rollback-state)Helm is in a pending-rollback state

An interrupted Helm upgrade process can leave your Helm release in a `pending-rollback` state. This state prevents further actions like upgrades, rollbacks, or deletions through standard Helm commands. To fix this:

1.  Identify the Helm release that’s in a `pending-rollback` state:

    ```bash
    helm list --namespace <namespace> --all
    ```

    Look for releases with a status of `pending-rollback`. These are the ones that need intervention.

2.  Verify the Secret’s status to avoid affecting the wrong resource:

    ```bash
    kubectl --namespace <namespace> get secret --show-labels
    ```

    Identify the Secret associated with your Helm release by its `pending-rollback` status in the labels.

    > ⚠️ **WARNING**
    >
    > Ensure you have correctly identified the Secret to avoid unintended consequences. Deleting the wrong Secret could impact other deployments or services.

3.  Delete the Secret to clear the `pending-rollback` state:

    ```bash
    kubectl --namespace <namespace> delete secret -l status=pending-rollback
    ```


After clearing the `pending-rollback` state:

-   **Retry the upgrade**: Restart the upgrade process. You should investigate the initial failure to avoid getting into the `pending-rollback` state again.

-   **Perform a rollback**: If you need to roll back to a previous release, use `helm rollback <release-name> <revision>` to revert to a specific, stable release version.


## [](#suggested-reading)Suggested reading

Set up a real-time dashboard to monitor your cluster health, see [Monitor Redpanda](https://docs.redpanda.com/streaming/23.3/manage/kubernetes/monitoring/).

## Suggested labs

-   [Migrate Data with Redpanda Migrator](https://docs.redpanda.com/labs/docker-compose/redpanda-migrator/)

[Search all labs](https://docs.redpanda.com/labs)