Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 40 additions & 19 deletions docs/update-operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,40 +165,61 @@ The upgrade includes the following steps.
}}'
```

5.


### Upgrade via helm
### Upgrade via Helm

If you have [installed the Operator using Helm](helm.md), you can upgrade the
Operator with the `helm upgrade` command.

1. Update the [Custom Resource Definition :octicons-link-external-16:](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/)
for the Operator, taking it from the official repository on Github, and do
the same for the Role-based access control:
The `helm upgrade` command updates only the Operator deployment. The [update flow for the database management system](update-db.md) is the same for all installation methods, whether it was installed via Helm or `kubectl`.

1. You must have the compatible version of the Custom Resource Definition (CRD) in all namespaces that the Operator manages. Starting with version 1.21.0, you can check it using the following command:

``` {.bash data-prompt="$" }
$ kubectl apply --server-side -f https://github.com/raw/percona/percona-server-mongodb-operator/v{{ release }}/deploy/crd.yaml
$ kubectl apply -f https://github.com/raw/percona/percona-server-mongodb-operator/v{{ release }}/deploy/rbac.yaml
$ kubectl get crd perconaservermongodbs.psmdb.percona.com --show-labels
```

2. If you installed the Operator with no [customized parameters :octicons-link-external-16:](https://github.com/percona/percona-helm-charts/tree/main/charts/psmdb-operator#installing-the-chart), the upgrade can be done as follows:

2. Update the [Custom Resource Definition :octicons-link-external-16:](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/)
for the Operator, taking it from the official repository on Github.

Refer to the [compatibility between CRD and the Operator](#considerations) and how you can update the CRD if it is too old. Use the following command and replace the version to the required one until you are safe to update to the latest CRD version.

``` {.bash data-prompt="$" }
$ helm upgrade my-op percona/psmdb-operator --version {{ release }}
$ kubectl apply --server-side -f https://github.com/raw/percona/percona-server-mongodb-operator/v{{ release }}/deploy/crd.yaml
```

The `my-op` parameter in the above example is the name of a [release object :octicons-link-external-16:](https://helm.sh/docs/intro/using_helm/#three-big-concepts)
which which you have chosen for the Operator when installing its Helm chart.
If you already have the latest CRD version in one of namespaces, don't re-run intermediate upgrades for it.

3. Upgrade the Operator deployment

If the Operator was installed with some [customized parameters :octicons-link-external-16:](https://github.com/percona/percona-helm-charts/tree/main/charts/psmdb-operator#installing-the-chart), you should list these options in the upgrade command.

=== "With default parameters"

To upgrade the Operator installed with default parameters, use the following command:

``` {.bash data-prompt="$" }
$ helm upgrade my-op percona/psmdb-operator --version {{ release }}
```

=== "With customized parameters"

If you installed the Operator with some [customized parameters :octicons-link-external-16:](https://github.com/percona/percona-helm-charts/tree/main/charts/psmdb-operator#installing-the-chart), list these options in the upgrade command.

You can get list of used options in YAML format with the `helm get values my-op -a > my-values.yaml` command, and this file can be directly passed to the upgrade command as follows:
1. Get the list of used options in YAML format :

```{.bash data-prompt="$" }
$ helm get values my-op -a > my-values.yaml
```

2. Pass these options to the upgrade command as follows:

``` {.bash data-prompt="$" }
$ helm upgrade my-op percona/psmdb-operator --version {{ release }} -f my-values.yaml
```
The `my-op` parameter in the above example is the name of a [release object :octicons-link-external-16:](https://helm.sh/docs/intro/using_helm/#three-big-concepts)
which you have chosen for the Operator when installing its Helm chart.
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation is inconsistent. Line 219 has extra spaces at the beginning that don't match the surrounding text formatting.

Suggested change
which you have chosen for the Operator when installing its Helm chart.
which you have chosen for the Operator when installing its Helm chart.

Copilot uses AI. Check for mistakes.


During the upgrade, you may see a warning to manually apply the CRD if it has the outdated version. In this case, refer to step 2 to upgrade the CRD and then step 3 to upgrade the deployment.

``` {.bash data-prompt="$" }
$ helm upgrade my-op percona/psmdb-operator --version {{ release }} -f my-values.yaml
```

### Upgrade via Operator Lifecycle Manager (OLM)

Expand Down