-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding postgresql-ha on obs cluster #597
Conversation
computate
commented
Nov 12, 2024
- created all the postgresql-ha config resources for the ai-telemetry project
- creation of external secrets
- creation of namespace
- created all the postgresql-ha config resources for the ai-telemetry project - creation of external secrets - creation of namespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Elsewhere we have been using the Crunchy Data postgres operator (https://github.com/CrunchyData/postgres-operator) to manage HA postgres deployments. I'm curious if you looked at that first (or at any of the other postgres operators)? I'm a little uncomfortable with the big chunk of logic we have to provide in the postgresql-ha-postgresql-hooks-scripts configmap.
Thanks for the feedback @larsks , My goal with
$ oc --as system:admin -n postgresql-ha exec pod/postgresql-ha-postgresql-0 -- bash -c 'env PGPASSWORD=$POSTGRES_PASSWORD psql -U $POSTGRES_USER postgres -c "create database test0;"'
CREATE DATABASE
$ oc --as system:admin -n postgresql-ha exec pod/postgresql-ha-postgresql-0 -- bash -c 'env PGPASSWORD=$POSTGRES_PASSWORD psql -U $POSTGRES_USER test0 -c "create table test0(pk bigserial primary key, k text, v text);"'
CREATE TABLE
$ oc --as system:admin -n postgresql-ha exec pod/postgresql-ha-postgresql-0 -- bash -c 'env PGPASSWORD=$POSTGRES_PASSWORD psql -U $POSTGRES_USER test0 -c "insert into test0(k, v) values('"'"'key0'"'"', '"'"'value0'"'"');"'
INSERT 0 1
$ oc --as system:admin -n postgresql-ha exec pod/postgresql-ha-postgresql-0 -- bash -c 'env PGPASSWORD=$POSTGRES_PASSWORD psql -U $POSTGRES_USER test0 -c "select * from test0;"'
pk | k | v
----+------+--------
1 | key0 | value0
$ oc --as system:admin -n postgresql-ha exec pod/postgresql-ha-postgresql-1 -- bash -c 'env PGPASSWORD=$POSTGRES_PASSWORD psql -U $POSTGRES_USER test0 -c "insert into test0(k, v) values('"'"'key1'"'"', '"'"'value1'"'"');"'
ERROR: cannot execute INSERT in a read-only transaction
command terminated with exit code 1
$ oc --as system:admin -n postgresql-ha exec pod/postgresql-ha-postgresql-2 -- bash -c 'env PGPASSWORD=$POSTGRES_PASSWORD psql -U $POSTGRES_USER test0 -c "insert into test0(k, v) values('"'"'key2'"'"', '"'"'value2'"'"');"'
ERROR: cannot execute INSERT in a read-only transaction
command terminated with exit code 1
(1 row)
The only difference I see is that Crunchy Postgres forces you to have a large enough backup storage for your all your databases, so you have to have double the storage with Crunchy, whereas postgresql-ha does not force a database backup solution on you. |
Closing this, we will use Crunchy Postgres instead. |
@computate do we have a PR for Crunchy Postgres? |
@joachimweyl not yet |