-
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
migrate from databaseUsername to databaseAccount #167
migrate from databaseUsername to databaseAccount #167
Conversation
b6a74eb
to
b5821b4
Compare
b5821b4
to
ba0040b
Compare
ba0040b
to
39a8dd8
Compare
// yet associated with any MariaDBDatabase. | ||
_, _, err = mariadbv1.EnsureMariaDBAccount( | ||
ctx, h, instance.Spec.DatabaseAccount, | ||
instance.Namespace, false, placement.DatabaseName, |
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.
do we need to set the requireTLS flag based on some input?
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.
tls is used as soon the mariadbdatabase reflects it is hosted on a galera supporting tls and the service has a CA to validate it. we could add setting requiredTLS as a follow up. maybe after we switched our default to enable podlevel/internal tls per default?
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.
I'm OK about a follow up, just seemed strange that we merged #165 yesterday in placement, and here we explicitly disable it. So I wanted to make sure it is intentional.
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.
the ensuremariadbaccount is ultimately going to be a receiver of a MariaDBAccount that may be coming from openstack-operator, and the account is not associated with any database as of yet. at this stage, it's not appropriate to set TLS, because nothing is yet known about what kind of database this account will be applied to. if we are flipping a TLS flag on when we do the ensure MariaDBDatabase phase, then we would want to flip on "require TLS" on the MariaDBAccount as well, and that would be within the mariadbdatabase_funcs. if that's the use we want? that is, if DB supports TLS, then all accounts should require TLS. is that a req?
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.
I'm OK about a follow up, just seemed strange that we merged #165 yesterday in placement, and here we explicitly disable it. So I wanted to make sure it is intentional.
right, setting requireTLS == false is not that then no tls is used for db connection. it is just that this db user could use tls and non tls to connect. if tls is used is being controlled by the my.cnf content.
that is, if DB supports TLS, then all accounts should require TLS. is that a req?
I am not sure right now. I can discuss it in our tomorrows tls meeting and get back
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.
thanks for the explanation. I defer to @stuggi if this is OK as is.
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.
we did not came up with a real preference if "require TLS" should be used as soon the DB supports TLS. since the services will use tls as soon the DB supports it and the service has the CA we could set it, but atm it won't hurt keep it available. I'd personally do it in a follow up, after we tested all the different scenarios, also with adoption in mind. adoption of tlse env is still in early phase.
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.
yah i think this should be all followup stuff. we're just trying to get all the levers available right now (like, every controller gets a distinct DB password, stuff like that :) )
// created here with a generated username as well as a secret with | ||
// generated password. The MariaDBAccount is created without being | ||
// yet associated with any MariaDBDatabase. | ||
_, _, err = mariadbv1.EnsureMariaDBAccount( |
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.
I feel that ensuring the DBAccount logically belongs to ensureDB, so I would move this new logic into that func.
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.
Yes I noticed that the recent merge has consolidated DB functions to be ahead of configmaps in any case, which was one of the reasons ensureaccount was up there. since ensureaccount isn't actually going away, for those controllers where ensuredb is before configmaps (Which I guess will be all of them now), might as well put ensure account into it. it starts to look like the whole of the various ensureDB functions could just be one big function in mariadb-operator, but i dont know that we have time to do all that just yet.
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.
yes, @stuggi fixed the ordering of the steps to have db created before we generate config. I would do the ensureDB consolidation here locally, and maybe looking at a common mariadb-operator/api function later separatly
39a8dd8
to
33e80c2
Compare
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.
looks good to me. We just need to land the mariadb dependency first
yah once mariadb lands I can re-crank through everyone and add mistral / telemetry / barbican also |
33e80c2
to
c05c31f
Compare
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.
I tested this and I was able to rotate the db password properly. Nice work!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gibizer, zzzeek The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
9270551
into
openstack-k8s-operators:main
This moves placement to fully use MariaDBAccount based on the dev work being done for mariadb-operator:
https://github.com/openstack-k8s-operators/mariadb-operator/pull/184/files
Lead Jira: OSPRH-4095
kuttl/*.yaml
kuttl/*.yaml