Closed evegufy closed 11 months ago
FYI @evegufy we moved this to our general tasks for system team to find together a way for updates
@FaGru3n next week we'll test a blue green deployment approach, just fyi as it may be affecting this issue.
This comment worked for me.
According to the Postgresql documentation:
Because pg_dump is used to transfer data to newer versions of PostgreSQL, the output of pg_dump can be expected to load into PostgreSQL server versions newer than pg_dump's version. pg_dump can also dump from PostgreSQL servers older than its own version. (Currently, servers back to version 8.0 are supported.) However, pg_dump cannot dump from PostgreSQL servers newer than its own major version; it will refuse to even try, rather than risk making an invalid dump. Also, it is not guaranteed that pg_dump's output can be loaded into a server of an older major version — not even if the dump was taken from a server of that version. Loading a dump file into an older server may require manual editing of the dump file to remove syntax not understood by the older server. Use of the --quote-all-identifiers option is recommended in cross-version cases, as it can prevent problems arising from varying reserved-word lists in different PostgreSQL versions.
kubectl exec -it portal-postgres-new-0 -n portal-postgres -- /opt/bitnami/scripts/postgresql/entrypoint.sh /bin/bash -c 'export PGPASSWORD="asd"; echo "local all postgres trust" > /opt/bitnami/postgresql/conf/pg_hba.conf; pg_ctl reload; time pg_dumpall -h 10.42.0.106 -U postgres | psql -U postgres'
where 10.42.0.106 was the cluster IP of the old version database.# Chart.yaml
apiVersion: v2
name: portal-postgres
description: A Helm chart for Kubernetes
type: application
version: 0.1.0
appVersion: "1.16.0"
dependencies:
- condition: postgresql.enabled
name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 11.9.13 # postgres 14
- condition: newpostgresql.enabled
name: postgresql
repository: https://charts.bitnami.com/bitnami
alias: newpostgresql
version: 12.12.10 # postgres 15
# values.yaml
postgresql:
enabled: false
auth:
database: "postgres"
port: 5432
postgresPassword: "asd"
newpostgresql:
enabled: true
fullnameOverride: portal-postgres-new
auth:
database: "postgres"
port: 5432
postgresPassword: "asd"
Let's try this tomorrow in a session.
A new follow-up issue is created to document the process so I would close this one.
I'm attempting to execute a major postgres version upgrade (from 14 to 15) for the containerized image from Bitnami.
Up to now, there doesn't exist an official documentation on how to upgrade those images: https://github.com/bitnami/charts/issues/8025 https://github.com/bitnami/charts/issues/14926
Therefore, I used a combination of the following two comments as guidance: https://github.com/bitnami/charts/issues/8025#issuecomment-1669896258 https://github.com/bitnami/charts/issues/8025#issuecomment-1704813690
Unfortunately, in the end, I'm always facing this error in step at step 8 of the list below: The source cluster was not shut down cleanly.
I assume because I'm not doing the following step 2 (from https://github.com/bitnami/charts/issues/8025#issuecomment-1704813690) correctly: "POSTGRES_DB must be unset in the Helm Release, otherwise migration script will complain about the present database." I'd next look into https://github.com/bitnami/charts/issues/8025#issuecomment-1708879837
Here the step that I'm executing:
enable diagnosticMode for postgres dependency
unset POSTGRES_DATABASE
Can you please support me for this issue?
Figuring out how to execute a postgres version upgrade for the containerized image from Bitnami could be beneficial to multiple products, not just for portal, as multiple products are using it as dependency.