Hi Mohammed,

Thanks a lot for reporting the bug. IMO at this point it is much easier to fix the db-init script and make it compatible with SQLAlchemy 2.0. I'll take care of this.

It is interesting that a couple days ago there was a small discussion in the #openstack-helm Slack chat about utilizing CRs when bootstrapping the deployments (specifically we discussed creating Keystone users). My first impression about this was that it is kinda a layer violation when you try to create such entities not directly but via K8s API. But it looks like there are cases when having this kind of simple operator for managing databases/users/keyrings could bring convenience. One of our users mentioned the Keystone federation case when some customization is necessary and using CRs is much easier than modifying the Keystone init script in the helm-tooking chart.

We also had a similar case when we switched to Rook managed Ceph clusters by default. We introduced the ceph-adapter-rook chart that creates Ceph keyrings/configs, but probably the operator would be more convenient here.

So, taking into account that this is not the first time this topic (OSH operator) has come up recently we could try to go this way. Let's maybe implement a POC for the start and then gather opinions.



On Fri, Jul 5, 2024 at 1:40 PM Mohammed Naser <mnaser@vexxhost.com> wrote:

Hi everyone!

 

It seems like our db-init jobs are broken with the latest version of OpenStack because it doesn’t work with SQLAlchemy 2.0

 

2024-05-31 03:21:34,290 - OpenStack-Helm DB Init - INFO - Got DB root connection

2024-05-31 03:21:34,290 - OpenStack-Helm DB Init - INFO - Using /etc/keystone/keystone.conf as db config source

2024-05-31 03:21:34,292 - OpenStack-Helm DB Init - INFO - Trying to load db config from database:connection

2024-05-31 03:21:34,292 - OpenStack-Helm DB Init - INFO - Got config from /etc/keystone/keystone.conf

2024-05-31 03:21:34,331 - OpenStack-Helm DB Init - INFO - Tested connection to DB @ percona-xtradb-haproxy.openstack.svc.cluster.local:3306 as root

2024-05-31 03:21:34,332 - OpenStack-Helm DB Init - INFO - Got user db config

2024-05-31 03:21:34,332 - OpenStack-Helm DB Init - CRITICAL - Could not create database keystone

Traceback (most recent call last):

  File "/tmp/db-init.py", line 112, in <module>

    root_engine.execute("CREATE DATABASE IF NOT EXISTS {0}".format(database))

AttributeError: 'Engine' object has no attribute 'execute'

 

I was wondering if it makes sense to fix this, or if this is something that we should just take the time to simply replace with some sort of simple operator that creates manages/watches database CRs (if one doesn’t exist?)

 

Thanks

Mohammed



--
Best regards,
Kozhukalov Vladimir