From 5f6ab2655a5124c1a0d09c3c7b4ba229e3c0fb14 Mon Sep 17 00:00:00 2001 From: Rayhan Hossain Date: Thu, 5 Nov 2026 12:20:06 -0800 Subject: [PATCH 1/2] docs: warn that helm upgrade keeps pinned image tags `helm upgrade` without new values reuses the previous release's values, so an install that pinned image.documentdbk8soperator.tag or image.sidecarinjector.tag keeps running the old operator after upgrading the chart. Found while upgrading an Azure Local cluster to 1.1.0. Document --reset-values and `helm get values`, and verify the running operator and sidecar images after the upgrade. Also correct the 1.1.0 CHANGELOG date to the actual release date (2026-11-04). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6c85cd4b-f086-46f7-8823-7e63c33e4de7 Signed-off-by: Rayhan Hossain --- CHANGELOG.md | 2 +- .../v1/operations/upgrades.md | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7ceda2d2..dadbaea43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,7 +24,7 @@ ### Enhancements & Fixes - Check loaded test images with `docker image inspect` instead of matching image-list output (#490). -## [1.1.0] - 2026-11-17 +## [1.1.0] - 2026-11-04 Operator release for DocumentDB 1.0; the default DocumentDB engine stays at `1.0.0` (extension schema `1.0-0`), so only the operator, sidecar and Helm chart change. Clusters on Kubernetes or container runtimes without image volume support (for example containerd 1.7, or Kubernetes 1.32) now run with a combined PostgreSQL + DocumentDB image instead of being rejected. Apply the 1.1.0 CRDs before `helm upgrade`; existing clusters keep their image layout and are not restarted. diff --git a/docs/operator-public-documentation/v1/operations/upgrades.md b/docs/operator-public-documentation/v1/operations/upgrades.md index 1f9185504..a6232af35 100644 --- a/docs/operator-public-documentation/v1/operations/upgrades.md +++ b/docs/operator-public-documentation/v1/operations/upgrades.md @@ -80,6 +80,19 @@ helm upgrade documentdb-operator oci://ghcr.io/documentdb/documentdb-operator \ --wait ``` +!!! warning "Pinned image tags are kept" + When you pass no new values, `helm upgrade` reuses the values from your previous install. If you set `image.documentdbk8soperator.tag` or `image.sidecarinjector.tag` (or other image overrides) at install time, the new chart deploys but the operator keeps running the old images. Add `--reset-values` to use the new chart's defaults, and pass again any settings you still need (for example `--set image.registry=...`): + + ```bash + helm upgrade documentdb-operator oci://ghcr.io/documentdb/documentdb-operator \ + --version ${TARGET_VERSION} \ + --namespace documentdb-operator \ + --reset-values \ + --wait + ``` + + Run `helm get values documentdb-operator -n documentdb-operator` to see which values your release currently overrides. + !!! tip Add `--atomic` to automatically roll back the release if the upgrade fails: @@ -96,6 +109,12 @@ helm upgrade documentdb-operator oci://ghcr.io/documentdb/documentdb-operator \ # Check operator deployment kubectl get deployment -n documentdb-operator +# Check the operator and sidecar run the new version's images +kubectl get deployment documentdb-operator -n documentdb-operator \ + -o jsonpath='{.spec.template.spec.containers[0].image}{"\n"}' +kubectl get deployment sidecar-injector -n cnpg-system \ + -o jsonpath='{.spec.template.spec.containers[0].image}{"\n"}' + # Check operator logs for errors kubectl logs -n documentdb-operator deployment/documentdb-operator --tail=50 ``` From 2c1a99c7f6bdc226324af1474fffa0a1d679be1a Mon Sep 17 00:00:00 2001 From: Rayhan Hossain Date: Mon, 16 Nov 2026 10:25:27 -0800 Subject: [PATCH 2/2] docs: address review feedback on the upgrade guide - Step 5: wait with kubectl rollout status and list the success criteria (rollouts complete, images match TARGET_VERSION, clusters healthy, no repeated operator errors, application read/write works). - Quote the TARGET_VERSION placeholder and explain that the chart version and release tag are the same value. - Qualify binary rollback: only to a version >= status.schemaVersion. - Say the walkthrough YAML shows only the fields to change. - Replace "permanent rollback window" with a compatibility caveat. - Show the merge patch that removes spec.image overrides when moving a 0.x cluster to 1.0. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9f1a71b4-9969-4456-9f65-8d19dd550d8e Signed-off-by: Rayhan Hossain --- .../v1/operations/upgrades.md | 38 ++++++++++++++----- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/docs/operator-public-documentation/v1/operations/upgrades.md b/docs/operator-public-documentation/v1/operations/upgrades.md index a6232af35..631e16b94 100644 --- a/docs/operator-public-documentation/v1/operations/upgrades.md +++ b/docs/operator-public-documentation/v1/operations/upgrades.md @@ -41,8 +41,9 @@ The DocumentDB operator Helm chart is published as an OCI artifact at `oci://ghc Pin the version you intend to upgrade to in a shell variable used by the rest of this guide: ```bash -# Set this to the release tag you are upgrading to. -TARGET_VERSION= +# Chart version to upgrade to, for example 1.2.0. Release tags use the same +# value (no "v" prefix), so it also selects the CRDs in Step 3. +TARGET_VERSION="" ``` ### Step 2: Review the Release Notes @@ -106,8 +107,9 @@ helm upgrade documentdb-operator oci://ghcr.io/documentdb/documentdb-operator \ ### Step 5: Verify the Upgrade ```bash -# Check operator deployment -kubectl get deployment -n documentdb-operator +# Wait for the operator and sidecar injector rollouts to finish +kubectl rollout status deployment/documentdb-operator -n documentdb-operator --timeout=5m +kubectl rollout status deployment/sidecar-injector -n cnpg-system --timeout=5m # Check the operator and sidecar run the new version's images kubectl get deployment documentdb-operator -n documentdb-operator \ @@ -115,10 +117,21 @@ kubectl get deployment documentdb-operator -n documentdb-operator \ kubectl get deployment sidecar-injector -n cnpg-system \ -o jsonpath='{.spec.template.spec.containers[0].image}{"\n"}' +# Check your DocumentDB clusters +kubectl get documentdb -A + # Check operator logs for errors kubectl logs -n documentdb-operator deployment/documentdb-operator --tail=50 ``` +The upgrade succeeded when: + +- Both `rollout status` commands report `successfully rolled out`. +- Both images end in `:${TARGET_VERSION}`. If they still show the old tag, your release pins image tags; see [Pinned image tags are kept](#step-4-upgrade-the-operator). +- Every DocumentDB cluster reports `Cluster in healthy state`. +- The operator logs show no repeated errors. A few `the object has been modified` messages right after the restart are retries and can be ignored. +- Your application can read and write through the gateway, for example a `mongosh` insert and find. + ### Operator Rollback If the new operator version causes issues, roll back to the previous Helm release: @@ -174,13 +187,13 @@ Upgrading a DocumentDB cluster has two dimensions: the **binary** (container ima | Field | What It Does | Reversible? | |-------|-------------|-------------| -| `spec.documentDBVersion` | Updates the **binary** — the extension image and gateway sidecar are replaced via rolling restart. | ✅ Yes — revert the field to roll back. | +| `spec.documentDBVersion` | Updates the **binary** — the extension image and gateway sidecar are replaced via rolling restart. | ✅ Yes, provided the target binary supports the current schema (it must be ≥ `status.schemaVersion`). See [Rollback and Recovery](#rollback-and-recovery). | | `spec.schemaVersion` | Runs `ALTER EXTENSION UPDATE` to migrate the **database schema** to match the binary. | ❌ No — schema changes are permanent. | Think of it as: **`documentDBVersion` installs the software, `schemaVersion` applies the database migration.** !!! info "Why two fields?" - The binary (container image) can be swapped freely — if something goes wrong, revert `documentDBVersion` and the pods roll back to the previous image. But `ALTER EXTENSION UPDATE` modifies database catalog tables and cannot be undone. Separating these two steps gives you a safe rollback window between deploying new code and committing the schema change. + The binary (container image) can be rolled back while the schema hasn't changed — revert `documentDBVersion` to a version that is ≥ `status.schemaVersion` and the pods roll back to that image. But `ALTER EXTENSION UPDATE` modifies database catalog tables and cannot be undone. Separating these two steps gives you a safe rollback window between deploying new code and committing the schema change. ### Schema Version Modes @@ -203,7 +216,7 @@ Think of it as: **`documentDBVersion` installs the software, `schemaVersion` app ### Upgrade Walkthrough -Choose the approach that matches your use case: +Choose the approach that matches your use case. The YAML examples show only the fields to change: update them in your existing manifest and keep all other required configuration unchanged. === "Production (two-phase upgrade)" @@ -283,7 +296,7 @@ Choose the approach that matches your use case: ``` !!! info - This pattern keeps a permanent rollback window. The schema is always one version behind the binary, so you never commit a schema change until the *next* binary has proven stable with it. + This pattern preserves a rollback option to the previous binary only when that binary supports the resulting schema. The schema stays one version behind the binary, so you don't commit a schema change until the *next* binary has proven stable with it. Confirm compatibility in the release notes before each upgrade. === "Development (auto mode)" @@ -365,7 +378,7 @@ Run DocumentDB 1.0 on operator `1.0.0`, the release tested with it. Before upgra | `0.117.0` or earlier `0.x` | Two-phase upgrade: set `documentDBVersion: "1.0.0"`, validate, then set `schemaVersion: "1.0.0"`. This runs `ALTER EXTENSION documentdb UPDATE TO '1.0-0'`, which cannot be undone. | | `1.0-RC2` (from chart `1.0.0-rc1`) | In-place upgrade is not supported: release-candidate clusters are for fresh instances only. Keep the cluster pinned to `1.0-RC2`, create a new `1.0.0` cluster, and move your data with `mongodump`/`mongorestore`. | -For a `0.x` cluster (if it sets `spec.image.documentDB` or `spec.image.gateway`, remove them in the first patch; explicit images take precedence over `documentDBVersion`): +For a `0.x` cluster: ```bash kubectl patch documentdb my-cluster -n default \ @@ -375,6 +388,13 @@ kubectl patch documentdb my-cluster -n default \ --type merge -p '{"spec":{"schemaVersion":"1.0.0"}}' ``` +If the cluster sets `spec.image.documentDB` or `spec.image.gateway`, explicit images take precedence over `documentDBVersion`. Remove them in the same first patch: + +```bash +kubectl patch documentdb my-cluster -n default --type merge \ + -p '{"spec":{"documentDBVersion":"1.0.0","image":{"documentDB":null,"gateway":null}}}' +``` + --- ## Multi-Region Upgrades