9.4. 删除保留的 Postgres 13 PVC


在将 Red Hat Ansible Automation Platform 从使用 Postgres 13 的版本升级到使用 Postgres 15 的版本后,原始 Postgres 13 持久性卷声明(PVC)不会自动删除使用受管数据库的自动化控制器部署。如果您的部署使用外部数据库,则不需要 PVC 清理。在确认升级成功完成后,您必须手动删除保留的 PVC。

先决条件

  • 您已将 Ansible Automation Platform 升级到使用 Postgres 15 的版本。
  • 您的自动化控制器部署使用受管数据库。使用外部数据库的部署不需要 PVC 清理。

流程

  1. 确认 Postgres 15 pod 正在运行:

    $ oc get pods -n <your_namespace> | grep postgres

    验证名称中包含 postgres-15 的 pod 是否处于 Running 状态。

  2. 列出命名空间中的 PVC 以识别保留的 Postgres 13 PVC:

    $ oc get pvc -n <your_namespace>

    保留 Postgres 13 PVC 遵循以下命名格式:

    postgres-13-<deployment_name>-postgres-13-0

    当前的 Postgres 15 PVC 采用以下命名格式:

    postgres-15-<deployment_name>-postgres-15-0
  3. 删除保留的 Postgres 13 PVC:

    $ oc delete pvc postgres-13-<deployment_name>-postgres-13-0 -n <your_namespace>
重要

在确认升级成功完成前,不要删除 Postgres 13 PVC。如果升级失败,则保留卷可用于数据恢复。

注意

AutomationController 自定义资源定义(CRD)中的 postgres_keep_pvc_after_upgrade 字段在 Ansible Automation Platform 2.4 及更高版本中没有影响。总是需要手动 PVC 清理。

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部