将openshift中的postgresql数据库备份到pod外

Backing up postresql database in openshift to outside the pod

正在寻找有关如何在 Openshift pod 中备份 postgresql 数据库 运行 的一些 guidance/best 实践。我遇到过这个用于应用程序数据的 rsync 解决方案 - https://docs.openshift.com/enterprise/3.2/admin_guide/backup_restore.html#backup-application-data - 但想知道如何使用 pg_dump?

我希望 pg_dump 将数据库转储到容器外的卷。

现在的最佳实践最有可能使用 Operator 来 运行 Kubernetes 上的 PostgreSQL,例如 Crunchy Data PostgreSQL Operator.

如果您不想使用运算符,另一种选择是定期使用 CronJob 到 运行 pg_dump 并将转储放在 PersistentVolume 安装到 Pod。