Skip to content
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

Add the ability to deploy Postgres in containers #751

Open
ruslanloman opened this issue Sep 9, 2024 · 3 comments
Open

Add the ability to deploy Postgres in containers #751

ruslanloman opened this issue Sep 9, 2024 · 3 comments

Comments

@ruslanloman
Copy link
Contributor

Hello,

Thank you for your great project.

Have you considered the option to deploy Postgres/Patroni/etcd/Haproxy in containers instead of installing packages.
This approach has many advantages.

  1. Easier cluster upgrades without worrying about package dependencies.
  2. Provides an OS-agnostic setup.
  3. Use docker upstream images for postgres, etcd.

Thank you!

@vitabaks
Copy link
Owner

vitabaks commented Sep 9, 2024

Hello @ruslanloman

Have you considered the option to deploy Postgres/Patroni/etcd/Haproxy in containers instead of installing packages.

Adding Docker support to the postgresql_cluster project would require significant changes to the automation code.

We believe Docker is not an ideal solution for databases in production environments, as it introduces unnecessary abstraction and an additional maintenance point. There are already Kubernetes operators for containerized solutions, but the strength of postgresql_cluster lies in its independence from Docker or Kubernetes.

This approach sets us apart from other HA solutions and, with its high-quality automation, it can serve as a solid alternative to both Kubernetes-based systems and managed databases from cloud providers.

@ruslanloman
Copy link
Contributor Author

Hello @vitabaks

Thank you for your reply.

Adding Docker support to the postgresql_cluster project would require significant changes to the automation code.

The postgresql_cluster ansible code is well written, so it shouldn't be a big problem to add an option to run the process in a container. I can help with adding such functionality as I'm very interested in it. I like the approach used in the Kubespray project, for example, for etcd

We believe Docker is not an ideal solution for databases in production environments, as it introduces unnecessary abstraction and an additional maintenance point. There are already Kubernetes operators for containerized solutions, but the strength of postgresql_cluster lies in its independence from Docker or Kubernetes.

I understand your point of view and partially agree. What I would like to achieve from using Docker/containerd is an operating system-agnostic PostgreSQL installation, as well as atomic upgrades and rollbacks, without worrying about potential package dependency issues. Using Docker/containerd would be an option, like having deb/rpm/docker.

This approach sets us apart from other HA solutions and, with its high-quality automation, it can serve as a solid alternative to both Kubernetes-based systems and managed databases from cloud providers.

That's why I like your project. We have a PostgreSQL cluster that is managed by a Kubernetes operator, but it becomes a challenge when we need to upgrade Kubernetes itself and manage the database.

Thank you!

@vitabaks
Copy link
Owner

vitabaks commented Sep 30, 2024

The postgresql_cluster ansible code is well written, so it shouldn't be a big problem to add an option to run the process in a container. I can help with adding such functionality as I'm very interested in it.

I appreciate your initiative, you can try to do it. I still think that it will not be easy because postgresql_cluster not only a tool for deployment but also for management. How will you implement support for e.g. pg_upgrade for containers?

Using Docker/containerd would be an option, like having deb/rpm/docker.

Yes, if you add it, then it should be an option that is not used by default. There is a variable installation_method that has the default value "repo", I think we can use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@ruslanloman @vitabaks and others