bitnami / charts

Bitnami Helm Charts
https://bitnami.com
Other
8.84k stars 9.13k forks source link

Postgres upgrade to 13 or 14 #7999

Closed dewnull closed 2 years ago

dewnull commented 2 years ago

Which chart: Postgres

Is your feature request related to a problem? Please describe. upgrade the docker image to version 13 or 14

Describe the solution you'd like release a new version of the helm chart that uses bitnami/postgresql version 13 or 14

Describe alternatives you've considered

image:
  repository: bitnami/postgresql
  tag: 13.4.0-debian-10-r80

Additional context helm upgrade would fail since you would get The data directory was initialized by PostgreSQL version 11, which is not compatible with this version 13.4.

alemorcuq commented 2 years ago

I will forward this to the engineering team for evaluation. Thanks.

angelsantillana94 commented 2 years ago

Hello @alemorcuq

the current version of the postgres charts (both HA and standard version) is 11.13.0

[name@host ~]$ helm search repo postgres 
NAME                                                CHART VERSION   APP VERSION DESCRIPTION                                       
bitnami/postgresql                                  10.13.4         11.13.0     Chart for PostgreSQL, an object-relational data...
bitnami/postgresql-ha                               7.12.4          11.13.0     Chart for PostgreSQL with HA architecture (usin...
[name@host ~]$ 

I am currently using the chart in HA mode, but I have a need to update to postgres version 12.

Is there any forecast to carry out this update?

Thank you very much for the help.

angelsantillana94 commented 2 years ago

Hello again,

checking other issues, I found the following:

https://github.com/bitnami/charts/issues/5061

In this issue, @javsalgar suggests the following:

"Even though we officially support PostgreSQL 11 in the chart, and that's the one we currently update, the chart should be able to work with PostgreSQL 12 by switching the image tag in the values"

Would this method really work correctly? Would there be no problem with the data directory paths?

@javsalgar could indicate the tag exactly that could be used for version 12

Thank you.

alemorcuq commented 2 years ago

Well, if you want to upgrade your cluster to a new PostgreSQL major version there's no plug and play solution, you will need to manually upgrade your data to the new version.

Here's some official PostgreSQL documentation on that: https://www.postgresql.org/docs/11/upgrading.html#UPGRADING-VIA-PGDUMPALL

angelsantillana94 commented 2 years ago

Hi @alemorcuq

It doesn't seem like an elegant solution for software running on kubernetes. This solution you are commenting on would be suitable for a cluster that is not running in a virtualized environment.

In case I wanted to update, the data would be in version 12 but the chart would really be version 11. In the deployment it will continue to appear with a tag of version 11 ... This does not seem logical to me.

If there is no plan to release a version 12 of the chart, I think I will have to find another solution.

Thank you.

alemorcuq commented 2 years ago

Unfortunately, no, there's no plan to release a chart for PostgreSQL 12. There are plans to upgrade the chart to a newer PostgreSQL version, but it will be PostgreSQL 14.

dewnull commented 2 years ago

Thank you for the update.

I am setting up a new database and I can verify that current helm chart works with PostgreSQL 13. Just Update the image tag.

Since bitnami maintains version parity between docker containers and the official PostgreSQL, it makes sense that the helm chart do the same.

As far as upgrading, I am not sure if the helm chart can support that. Maybe using Helm hooks or init containers?

alemorcuq commented 2 years ago

We don't like using Helm hooks in our charts since there are many users that only use Helm as a templating tool and don't use it to manage the application. As for init containers, it may be possible to do something with them.

github-actions[bot] commented 2 years ago

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

github-actions[bot] commented 2 years ago

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.

collimarco commented 2 years ago

Any updates on this? What is the proper way (step by step) to upgrade PostgreSQL when using Bitnami charts?

krishnapatamsettisonos commented 1 year ago

Currently having the same issues while migration. Any steps to do the data migration for a containerized env like Kubernetes?

felipecrs commented 1 year ago

The following would probably be useful in this scenario:

https://github.com/tianon/docker-postgres-upgrade