如果您运行的是 AlloyDB Omni 操作器 1.0.0 版或更高版本,则后续步骤取决于您要升级到的 AlloyDB Omni 版本。这进而需要了解 AlloyDB Omni 版本号。
AlloyDB Omni 版本号包含以下组成部分:
PostgreSQL 兼容性的主要版本号
PostgreSQL 兼容性的次要版本号
此 AlloyDB Omni 发布版本的补丁版本号
例如,AlloyDB Omni 15.5.5 版是支持 PostgreSQL 15.5 版的 AlloyDB Omni 的第 5 个补丁版本。
如果您希望升级到支持较新版本 PostgreSQL 的 AlloyDB Omni 版本,则必须将 AlloyDB Omni 操作器本身与您的数据库集群一起升级。每组支持特定 PostgreSQL 次要版本的 AlloyDB Omni 发布版本都有自己的 AlloyDB Omni 操作器版本号,您可以在 AlloyDB Omni 版本的版本说明中找到该版本号。
如果您只想升级到较新的 AlloyDB Omni 补丁版本,则可以只升级数据库集群,而无需升级 AlloyDB Omni 操作器本身。
如果您的 AlloyDB Omni 集群是使用 AlloyDB Omni 操作器 1.0.0 创建的,请先将 controlPlaneAgentsVersion 字段添加到清单中并将其设置为 1.1.0,然后再将集群升级到 15.5.5 版。否则,系统会显示以下错误:
admission webhook "vdbcluster.alloydbomni.dbadmin.goog" denied the request: unsupported database version 15.5.5 and/or control plane agents version 1.0.0
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-03。"],[[["\u003cp\u003eThis page provides instructions for upgrading the AlloyDB Omni Operator from version 1.0.0 to 1.1.0 in a Kubernetes environment.\u003c/p\u003e\n"],["\u003cp\u003eUpgrading involves first determining the current versions of both the AlloyDB Omni used by your database cluster and the AlloyDB Omni Operator running on your Kubernetes cluster.\u003c/p\u003e\n"],["\u003cp\u003eIf upgrading to a newer PostgreSQL version, the AlloyDB Omni Operator must be upgraded alongside the database cluster; otherwise, only the database cluster needs to be upgraded for patch version updates.\u003c/p\u003e\n"],["\u003cp\u003eThe upgrade process for the AlloyDB Omni Operator includes defining environment variables, downloading the latest operator, applying custom resource definitions, and upgrading the Helm chart.\u003c/p\u003e\n"],["\u003cp\u003eUpgrading to version 1.1.0 of the AlloyDB Omni Operator will cause a brief interruption to the database cluster, and requires setting the \u003ccode\u003econtrolPlaneAgentsVersion\u003c/code\u003e field in the manifest file if the cluster was created with version 1.0.0.\u003c/p\u003e\n"]]],[],null,["# Migrate to the latest version of the AlloyDB Omni Kubernetes Operator\n\nSelect a documentation version: 15.5.5keyboard_arrow_down\n\n- [15.7.0](/alloydb/omni/15.7.0/docs/migrate-to-latest-version-kubernetes)\n- [15.5.5](/alloydb/omni/15.5.5/docs/migrate-to-latest-version-kubernetes)\n- [15.5.4](/alloydb/omni/15.5.4/docs/migrate-to-latest-version-kubernetes)\n\n\u003cbr /\u003e\n\nThis page covers instructions for upgrading from version 1.0.0 to version 1.1.0 of the AlloyDB Omni Operator.\n\n\u003cbr /\u003e\n\nThe steps that you take to upgrade AlloyDB Omni in Kubernetes depend upon the version of AlloyDB Omni that you run, and the version that you upgrade to.\n\nDetermine your current version numbers\n--------------------------------------\n\n### Kubernetes\n\nTo check the version of AlloyDB Omni used by your database cluster,\nrun this command: \n\n kubectl get dbclusters.alloydbomni.dbadmin.goog \u003cvar translate=\"no\"\u003eDB_CLUSTER_NAME\u003c/var\u003e -n \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e -o jsonpath='{.status.primary.currentDatabaseVersion}'\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eDB_CLUSTER_NAME\u003c/var\u003e: the name of your database\n cluster. It's the same database cluster name that you declared when [you created\n it](/alloydb/omni/15.5.2/docs/deploy-kubernetes#create).\n\n- \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e: the Kubernetes namespace of your database cluster.\n\nIf you run version 1.0.0 or later of the AlloyDB Omni Operator, then this command\nprints the version of AlloyDB Omni used by your\ndatabase cluster.\n\nTo check the version of the AlloyDB Omni Operator installed on your\nKubernetes cluster, run this command: \n\n kubectl get dbclusters.alloydbomni.dbadmin.goog \u003cvar translate=\"no\"\u003eDB_CLUSTER_NAME\u003c/var\u003e -n \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e -o jsonpath='{.status.primary.currentControlPlaneAgentsVersion}'\n\nIf you run version 1.0.0 or later of the AlloyDB Omni Operator, then this command\nprints the version number of the AlloyDB Omni Operator\nrunning on your Kubernetes cluster.\n\nIf you run a version of AlloyDB Omni Operator earlier than\n1.0.0, follow the instructions in [Upgrade from a pre-1.0.0\nAlloyDB Omni Operator](/alloydb/omni/15.5.2/docs/manage#older-operator).\n\nOtherwise, continue to the [Check your target version numbers](#check-target-version) section.\n\nCheck your target version numbers\n---------------------------------\n\n### Kubernetes\n\nIf you run a version of AlloyDB Omni Operator 1.0.0 or later, then your\nnext steps depend upon the version of AlloyDB Omni that you want to upgrade to.\nThis, in turn, requires understanding of the AlloyDB Omni version number.\n\nThe AlloyDB Omni version number has the following components:\n\n- The major version number of its PostgreSQL compatibility\n- The minor version number of its PostgreSQL compatibility\n- The patch version number of this AlloyDB Omni release\n\nFor example, AlloyDB Omni version 15.5.5 is patch version 5 of the AlloyDB Omni that supports PostgreSQL version 15.5.\n\nIf you want to upgrade to a version of AlloyDB Omni that supports a newer\nversion of PostgreSQL, then you must upgrade the AlloyDB Omni Operator\nitself, alongside your database cluster. Each set of AlloyDB Omni\nreleases that support a particular PostgreSQL minor version has its own\nAlloyDB Omni Operator version number, which you can find\nin [the release note](/alloydb/docs/release-notes) for the AlloyDB Omni version.\n\nIf you want to upgrade only to a newer patch version of AlloyDB Omni, then you can [upgrade](/alloydb/omni/15.5.5/docs/migrate-to-latest-version) only your database cluster, with no need to\nupgrade the AlloyDB Omni Operator itself.\n\nOtherwise, continue to the [Upgrade the AlloyDB Omni Operator](#upgrade-operator) section.\n\nUpgrade the AlloyDB Omni Operator\n---------------------------------\n\n### Kubernetes\n\nTo upgrade the AlloyDB Omni Operator, follow these steps:\n\n1. Define the environment variables:\n\n export GCS_BUCKET=alloydb-omni-operator\n export OPERATOR_VERSION=\u003cvar translate=\"no\"\u003eOPERATOR_VERSION\u003c/var\u003e\n export HELM_PATH=$OPERATOR_VERSION/alloydbomni-operator-$OPERATOR_VERSION.tgz\n\n Replace \u003cvar translate=\"no\"\u003eOPERATOR_VERSION\u003c/var\u003e with the version of the\n AlloyDB Omni Operator that you are upgrading to---for example,\n `1.1.0`.\n2. Download the latest AlloyDB Omni Operator:\n\n gcloud storage cp -r gs://$GCS_BUCKET/$HELM_PATH ./\n tar -xvzf alloydbomni-operator-${OPERATOR_VERSION}.tgz\n\n3. Apply the latest AlloyDB Omni Operator custom resource\n definitions:\n\n kubectl apply -f alloydbomni-operator/crds\n\n4. Upgrade the AlloyDB Omni Operator Helm chart:\n\n helm upgrade alloydbomni-operator alloydbomni-operator-${OPERATOR_VERSION}.tgz \\\n --namespace alloydb-omni-system \\\n --atomic \\\n --timeout 5m\n\nAfter completing the upgrade of your AlloyDB Omni Operator, follow the instructions in [Perform an in-place upgrade](/alloydb/omni/15.5.5/docs/migrate-to-latest-version#perform-in-place-upgrade) to create a new database cluster.\n\nIf your AlloyDB Omni cluster was created with AlloyDB Omni Operator 1.0.0, then add the `controlPlaneAgentsVersion` field to the manifest and set it to `1.1.0` before upgrading the cluster to version 15.5.5. Otherwise, the following error displays: \n\n admission webhook \"vdbcluster.alloydbomni.dbadmin.goog\" denied the request: unsupported database version 15.5.5 and/or control plane agents version 1.0.0\n\nA sample manifest with the `controlPlaneAgentsVersion` field looks as follows: \n\n```html\napiVersion: alloydbomni.dbadmin.goog/v1\nkind: DBCluster\nmetadata:\n name: DB_CLUSTER_NAME\nspec:\n databaseVersion: \"15.5.5\"\n controlPlaneAgentsVersion: \"1.1.0\"\n...\n```\n| **Note:** Upgrading to version 1.1.0 of the AlloyDB Omni Operator results in a brief interruption to all database clusters. No data loss is expected."]]