Add recipe to set up PostgreSQL replication, rewrite kosmos-postgresql cookbook #163
Labels
Clear labels
monitoring
bug
design
dev environment
docs
duplicate
enhancement
feature
good first issue
idea
invalid
kredits-1
kredits-2
kredits-3
on hold
ops
question
security
ui/ux
wontfix
service
discourse
Kosmos Community Forums
Infrastructure metrics, alerts, notifications, etc.
service
accounts
Kosmos Accounts
service
drone-ci
Kosmos Drone CI
service
email
mail.kosmos.org
service
garage
S3-compatible object storage
service
gitea
Kosmos Gitea
service
ipfs
Kosmos IPFS
service
mastodon
kosmos.social
service
nostr
Relays, Blossom server, etc.
service
postgres
Database cluster
service
remotestorage
Portable data storage for the Web
service
wiki
Kosmos Wiki
service
xmpp
Kosmos Chat
Something is not working
Graphic/visual design
Config, builds, CI, deployment, etc.
Documentation
This issue or pull request already exists
Improving existing functionality
New functionality
Dive in, and start contributing
Something to consider
Not a bug
Small contribution
Medium contribution
Large contribution
Currently not actionable
Manual IT ops activities
Looking for an answer
release
major
release
minor
release
patch
All your base are belong to us
User interface, process design, etc.
This won't be fixed
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: kosmos/chef#163
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
See the README in the kosmos-postgresql cookbook (
site-cookbooks/kosmos-postgresql/README.md) for docs about the custom resource. For replication, Chef needs to run once on the replica, then once on the primary to set up the access rules, and then a second time on the replicaAlso upgrade PostgreSQL from 10 to 12 (10 is the version running on andromeda right now)
Refs #160
I glanced over everything and added a few comments to the mentioned README.
@@ -3,2 +3,3 @@TODO: Enter the cookbook description here.## Custom resources### `postgresql_custom_server`What's "custom" about these servers? If "custom" merely means that it's going to be configured for our use case, then isn't that the case for literally every other server, too?
They're Chef custom resources (https://docs.chef.io/custom_resources/), the concept that replaces LWRP (https://chef.readthedocs.io/en/latest/lwrps_custom.html)
@@ -5,0 +24,4 @@```rubypostgresql_custom_server "12" dorole "primary"The replica also needs to have "primary" as role?
Thanks, I've pushed a fix for the typo
@@ -5,0 +38,4 @@[`firewall_rules`](https://github.com/chef-cookbooks/firewall/issues/134) and[`postgresql_access`](https://github.com/sous-chefs/postgresql/issues/648) needto be declared in recipes, not resources because of the way custom resourceswork currently in ChefWhich rules are needed? How are they declared? I believe this README would not answer these questions for someone trying to use it.
Left a couple of comments/questions.
@@ -5,0 +57,4 @@the PostgreSQL server.The root certificate needs to be deployed to clients so they verify the certcan be trusted.I don't see where that's done in this PR?
I forgot to remove that part from the README, as we said in #160 that we don't care about verifying the root cert. It would be done in the cookbooks for software that connects to PostgreSQL (together with creating databases) and not in this cookbook
@@ -51,1 +73,4 @@end# TODO: We need to set up firewall rules and access rules for clients too# (Mastodon, ejabberd, etc)What does this mean? Why would they use a different port to connect to Postgres?
I'm removing that line, this will be done as part of the Mastodon, ejabberd, gitea cookbooks. They wouldn't use a different port, but clients still need access for the specific database, user and IP (https://www.postgresql.org/docs/12/auth-pg-hba-conf.html)