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

Support postgres or other RDBMS for HA cluster state #5858

Closed
sskousen opened this issue Mar 4, 2021 · 3 comments
Closed

Support postgres or other RDBMS for HA cluster state #5858

sskousen opened this issue Mar 4, 2021 · 3 comments
Labels
c-aw Internal Customer Reference c-im Internal Customer Reference c-ju Internal Customer Reference c-m Internal Customer Reference feature-request Used for new features in Teleport, improvements to current should be #enhancements

Comments

@sskousen
Copy link

sskousen commented Mar 4, 2021

What

What would you like Teleport to do differently?

Support RDBMS's like postgres or mysql for cluster state, and potentially audit logs.

How

(Making a lot of assumptions here). Since teleport auth nodes already support sqlite on local storage as a backend, I would expect the majority of the SQL logic to already be built out.

  1. Port SQLite logic to postgres driver, or abstract it into a generic SQL driver with different implementations.
  2. Add config variables to teleport.yaml for postgres port/username/password/host/etc
  3. (This is a hack, but might be the easiest to implement). Since then teleport SQLite connection doesn't support multiple nodes currently, add an 'ha' table to postgres that acts as a key/value store and basically override the etcd function to write to postgres instead of etcd.

Why

Currently, teleport only supports clustered, NoSQL-like storage for cluster state (etcd/dynamo). While these technologies work great, there's also a lot of specialized knowledge and configuration that needs to be done to actually build them in a secure, highly available manner, as well as maintaining and updating them. For small or simple use-cases they can take more time to manage than teleport itself does, especially if it's exclusively being setup for teleport.

At $dayjob, we're a postgres shop, and have a ton of expertise in building and maintaining highly-available postgres clusters. Being able to point teleport directly at postgres for it's cluster state (and potentially even audit logs), would be one less technology that we have to maintain and update (which to be honest, we aren't doing with etcd).

I would also argue that postgres/mysql is simpler to setup and maintain than etcd (the only on-prem storage solution for multiple auth nodes currently supported). I've been burned a number of times by not knowing that I needed to cap etcd revisions, configure auto pruning of those revisions, not to mention getting backups working correctly. That's partly on me for not doing enough research, but I also know that sudo apt-get install postgresql will get me a postgres server in a working and reliable state, and there are tons of tutorials and guides on how to properly configure and architect postgres. If I want to setup replication, SSL, or backups, there are tons guides to get those working too. The vast majority of dev/engineers/etc are going to be much more familiar with RDBMS because of rails, django, etc that are built around them, than etcd or dynamo.

I believe the cluster and audit schemas are stable and consistent enough to be easily translated to columns/tables, but have not really dug into them that much.

Additionally, if only standard SQL is used, it should be as easy as adding the DB driver to support another RDBMS one the initial SQL logic is implemented.

While not a critical need at the moment, postgres should be able to handle a huge amount of audit logs. It would also make querying and filtering those logs a lot easier, since there would be columns.

Workaround

If a workaround exists, please include it.

@sskousen sskousen added the feature-request Used for new features in Teleport, improvements to current should be #enhancements label Mar 4, 2021
@aelkugia aelkugia added the c-m Internal Customer Reference label Mar 18, 2021
@yjperez yjperez added the c-ju Internal Customer Reference label Mar 24, 2021
@yjperez yjperez added the c-im Internal Customer Reference label Apr 7, 2021
@pschisa pschisa added the c-aw Internal Customer Reference label Feb 25, 2022
@pschisa
Copy link
Contributor

pschisa commented Jun 23, 2022

We now support this functionality for cluster state: https://goteleport.com/docs/ver/9.0/setup/reference/backends/#postgresqlcockroachdb-preview

@pschisa pschisa closed this as completed Jun 23, 2022
@pschisa
Copy link
Contributor

pschisa commented Nov 11, 2022

reopening as the preview was removed

@pschisa pschisa reopened this Nov 11, 2022
@zmb3
Copy link
Collaborator

zmb3 commented Aug 11, 2023

Postgres backend was released in 13.3

@zmb3 zmb3 closed this as completed Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-aw Internal Customer Reference c-im Internal Customer Reference c-ju Internal Customer Reference c-m Internal Customer Reference feature-request Used for new features in Teleport, improvements to current should be #enhancements
Projects
None yet
Development

No branches or pull requests

5 participants