Skip to main content
A managed PostgreSQL service that Ankra runs in your cluster can change after setup in four ways:
  • Resize it: more or fewer instances, the Standard or Production tier, more storage, other CPU or memory.
  • Upgrade it to a newer version of its package within the same PostgreSQL major.
  • Roll back an upgrade whose roll failed, to the version the service ran before.
  • Rotate its owner credential, the password of the database owner app.
Each change takes two steps. Preparing it stores a review that says what will happen to the running database, and changes nothing. Confirming the review by its digest, within 10 minutes, makes the change. The service keeps its name, its data and its connections through all four. Resizing and upgrading are available through the API, over MCP and in Ask Ankra, which asks you to approve each confirmation. Rotating the owner credential is available through the API. The Ankra CLI and the web app have no command or page for these changes yet. Other services, such as Valkey or OpenSearch, cannot be resized or upgraded yet. To give one of them other settings, delete it and set it up again, which starts it with new credentials and none of its data.

Before you start

  • The service is a PostgreSQL service Ankra runs in one of your clusters, and its installation has finished.
  • Your role allows it: applications.deploy in the project of the service’s cluster, and clusters.read and clusters.operate on the service’s cluster. Rotating the owner credential also needs clusters.read and clusters.operate on the cluster of every application environment connected to the service. The built-in owner, admin and operator roles hold all of them. See Roles and access.
  • You have the service’s id and generation. Read the service with Get a managed service instance, or get_service_instance over MCP, for its id and generation. A review is prepared for the generation you read, and a review of any other generation is refused, so read the service again after it changed.
Each person can hold at most 10 reviews of each kind waiting for confirmation, and each organisation 50. A review you do not confirm expires on its own and changes nothing.

Resize the service

A resize changes any of these settings and keeps the others. The ranges are the package’s, as under Managed Service Settings: What happens to the running database depends on what changes, and the review says it in its effects:
  • CPU or memory. CloudNativePG restarts each instance with the new values, the replicas first and the primary last after a switchover, so connections to the primary drop once. A single instance is unavailable until it is back, usually under a minute.
  • Tier. CloudNativePG recreates the instances one at a time, the replicas first and the primary last after a switchover.
  • More instances. Each new instance is a replica cloned from the primary, which keeps serving while they join. Fewer instances removes replicas and their volumes, and the primary keeps serving.
  • Storage. Every instance’s volume grows in place, without a restart where the StorageClass expands volumes online. It can never be made smaller again. A grow is refused up front when a StorageClass of the service’s volumes does not allow volume expansion.
The Production tier needs 3 instances and three nodes that can run them, as at setup, and is refused on a playground.
1

Prepare the resize

Prepare a managed-service resize review with the settings to change:
The answer carries the resize’s id, its plan and its digest. The plan lists each change with its old and new value in changes, the stack variables that move in variables, and what happens to the database in effects. Nothing changes yet.
2

Confirm it by its digest

Confirm a managed-service resize by its digest within the 10 minutes:
The platform resolves the plan again and refuses when anything it covers changed since the review. It then writes the new size to the service’s stack and deploys it, and operation_id is that deployment. Confirming again with the same digest returns the same resize.

Upgrade the service

An upgrade moves the service to a newer version of its own package that runs the same PostgreSQL major, such as a newer PostgreSQL 18 release. Name the version as target_version_id, or leave it out to move to the newest version your organisation can use. List visible package versions lists the versions with their ids. Moving to another PostgreSQL major is not available yet. The review shows the package version, profile version, PostgreSQL image and CloudNativePG cluster chart the service moves from and to, the changelog between them, the disruption, the applications connected, and the stack’s backup policy, which the upgrade keeps. The service keeps its name, data, credentials, connections and size.
  • Each instance restarts once onto a new image. With replicas, CloudNativePG restarts the replicas first, then switches the primary role over and restarts the old primary, so connections to the primary drop once and the service keeps serving. A single instance is unavailable while it restarts. When the image does not change, no instance restarts for an image, and the changelog says what else changes.
  • No backup is taken first. The most recent restore point is the one the backup policy last took. To have a newer one, take it before you confirm: ankra cluster stacks restore-points create <service> --cluster <cluster> --wait.
  • The service must be serving, and is refused while a resize or retirement review of it is open.
1

Prepare the upgrade

Prepare a managed-service upgrade review:
Add "target_version_id": "<version-id>" to move to a version other than the newest. The answer carries the upgrade’s id, its plan and its digest, and backup_observation, what the platform last saw of the service’s backups. Nothing changes yet.
2

Confirm it by its digest

Confirm a managed-service upgrade by its digest within the 10 minutes:
The platform resolves the plan again, including that the service is still serving, rolls the new version onto the service’s stack in place and deploys it. operation_id is that deployment.

Roll back an upgrade whose roll failed

When the deployment of an upgrade fails or is cancelled and the service stops serving, an upgrade can still be prepared. The way back is to prepare an upgrade again, as above, back to the version the service ran before. Name that version as target_version_id: it is plan.from.package_version_id in the review of the upgrade that failed, and List visible package versions lists it with its id too. The review then carries plan.rollback: true. Preparing to a newer version than the failed one is allowed as well. A rollback moves back the package version, the profile version, the PostgreSQL image, which restarts the instances when it differs, and the CloudNativePG cluster chart. It does not restore data: the service keeps its data, name, credentials, connections and size as they are. To go back to the data of an earlier moment, restore the service into a new service. A rollback that would move another add-on to an older chart is refused, and names the add-on. A rollback is offered only while Ankra can show that the roll of the last upgrade failed. While that deployment is still running, or succeeded, the service is refused as not serving, and the refusal says why.

Rotate the owner credential

Rotating changes the password of app, the owner of the database app, which the service keeps in the Secret postgresql-app. Ankra deletes that Secret, and CloudNativePG creates it again with a password it generates in the cluster and sets on app. Ankra never sees, stores or logs the password. Every application connected with the owner credential is affected, and the review names each one:
  • An application on the owner credential keeps its open connections until they close, but cannot open new ones with the old password. Its next deploy copies the new password into its connection and rolls the pods that read it, so deploy each such application once you have confirmed. There is no period in which both passwords work.
  • An application with a PostgreSQL role of its own is not affected. See Which credential your application connects with.
  • Copies of the password made by hand, such as the values given to an application on another cluster, stop working, and so does a copy a disconnected application may still hold.
1

Prepare the rotation

Prepare a managed-service owner credential rotation review:
The answer carries the rotation’s id, its plan and its digest. The plan’s consumers says, for each connected application environment, whether it is on the owner credential, has a role of its own, has no connection delivered yet, or runs on another cluster, and breaking counts those whose connection breaks; the plan’s statements.other_copies says what else stops working. Nothing changes yet.
2

Confirm it by its digest

Confirm a managed-service owner credential rotation by its digest within the 10 minutes:
The answer’s effect says whether the rotation took effect. taken: Ankra saw the new Secret, and each application environment on the owner credential now needs a deploy. awaiting: Ankra has not seen the new Secret yet, and confirming again reads it again. lapsed: the rotation never took effect.
3

Deploy the applications on the owner credential

Deploy each application environment the review named as on the owner credential. Until its next deploy, it cannot open new connections to the database.

Troubleshooting

Every change is refused before anything is written, and says why.

Next steps

Managed Service Settings

Every PostgreSQL setting, its range and what it changes.

Restore a PostgreSQL service

Create a new service from the backups of another one, as of a moment you choose.