-
-
Notifications
You must be signed in to change notification settings - Fork 66
Support multiple global postgres-operators with filter on annotation #86
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 multiple global postgres-operators with filter on annotation #86
Conversation
I was distracted by another project, so didn't had time to follow-up on this, until today. I still need to update the README, but would love to have some feedback if this is mergeable or not. @hitman99 ? |
Thanks for putting some work into this proposal. I was super busy since the January and will finally have some time to allocate to this project starting July |
We'd also be interesting in this. We're currently using the operator to manage 1 central azure database, but we're evaluating moving to flexible server as well. How can we help with this PR? |
I'm planning to review this and other PRs and issues on Monday 08-29 as it's long overdue. |
Hi @hitman99 I missed it that you reviewed this, I just processed your feedback. |
This is a first draft, and is untested (I'm in the process of setting up some infra to test it properly). I already open this PR to get some early feedback.
Currently you can run multiple postgres operators, and configure which namespaces it should watch. Unfortunately I am having an use-case where the namespaces are dynamic.
I liked the idea of #46, but it seems to be stale, and it would also mean a major refactor with breaking changes.
This PR is just add the "basic" feature of running multiple postgres-operator's that can watch all the namespaces, but with a filter on the annotation.
We introduce a new config
POSTGRES_INSTANCE
, that defines the "filter" for the CR's. If this is defined the operator will only process the CR's with the annotationpostgres.db.movetokube.com/instance
, and where the value equals the configured value inPOSTGRES_INSTANCE
.If the config
POSTGRES_INSTANCE
is not set, it will process all CR's that have no annotationpostgres.db.movetokube.com/instance
. This means it should be fully backwards compatible with the current way of working.I also updated to go 1.18, and had to updated the
golang.org/x/sys
package to be compatible with the new golang version. Dockerfile.dist is bumped toubi8
(not sure if ubi7 still gets security updates?). If you want I can split up the PR for this.Some thoughts:
No idea how the code will respond if aAdded check for thisPostgres
is handled by operator X, and thePostgresUser
by operator Y.