Skip to content

Let pods report their state to the operator#472

Merged
openshift-merge-bot[bot] merged 1 commit into
openstack-k8s-operators:mainfrom
dciabrin:seqno-push
Jun 5, 2026
Merged

Let pods report their state to the operator#472
openshift-merge-bot[bot] merged 1 commit into
openstack-k8s-operators:mainfrom
dciabrin:seqno-push

Conversation

@dciabrin

@dciabrin dciabrin commented May 26, 2026

Copy link
Copy Markdown
Contributor

Reverse the introspection approach for bootstrapping the cluster. Until now, the mariadb operator was in charge in running scripts inside pods to extract the state of the mysql database.

Now the pod are responsible for reporting the state of their database to the operator, by updating their associated galera CR via calls to the API server. This allows asynchronous reporting from the operator's perspective, and ensure that newly (re)started pod will always update the operator state, preventing stale data to linger in the galera CR status.

Jira: OSPRH-23075

@dciabrin dciabrin requested review from lmiccini and zzzeek May 26, 2026 15:57
@openshift-ci openshift-ci Bot requested a review from stuggi May 26, 2026 15:57
@dciabrin dciabrin requested a review from antonioromito May 26, 2026 16:00
@@ -0,0 +1,170 @@
#!/usr/bin/python3

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i find it unusual there's no .py extension here? what's the rationale for that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I originally implemented it in bash, then moved it to python. And since we have this pattern of bind-mounting files directly which is causing us concerns during minor update if anything changes, I figured there was no point it exposing the language here. So I discarded the extension.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, so then it's suggestive of a practice we would in theory have for all of our files is that accurate?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is something that I would like, but I'm open to discussion. When I rewrote this new script in python, I figured all the other scripts would likely benefit from being rewritten in a higher-lever language eventually, and if so, their filename would need to be updated.

So right now I'm in favor of getting rid of file extension in those injected scripts, because we own them, we may need to change their implementation later, and we can set our own convention anyway, so why not.

Do you have a strong opinion on that, maybe we should keep the extension if you think it makes sense?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i sorta like having the extension :) but the whole "we changed our approach and new bind mounts are a problem" would be the reason we wouldnt, but what is the problem with new bindmounts ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll re-add the extension then, not a big deal.
The problem with adding changing bind-mounts is that we have to special case our code we every new path, because we have to support rolling update, even from an old FRx version to the latest.
(I added https://github.com/openstack-k8s-operators/mariadb-operator/tree/main/test/ansible to verify that new code doesn't break rolling update, it will become a voting prow job in a subsequent PR.)

@dciabrin

Copy link
Copy Markdown
Contributor Author

/recheck

@dciabrin

Copy link
Copy Markdown
Contributor Author

/test mariadb-operator-build-deploy-chainsaw

@dciabrin dciabrin force-pushed the seqno-push branch 2 times, most recently from ade476b to 718cfeb Compare May 28, 2026 07:51
@dciabrin

Copy link
Copy Markdown
Contributor Author

/retest

@dciabrin

Copy link
Copy Markdown
Contributor Author

/test mariadb-operator-build-deploy-chainsaw
prow env seems to be having issues

Reverse the introspection approach for bootstrapping the cluster.
Until now, the mariadb operator was in charge in running scripts
inside pods to extract the state of the mysql database.

Now the pod are responsible for reporting the state of their
database to the operator, by updating their associated galera CR
via calls to the API server. This allows asynchronous reporting
from the operator's perspective, and ensure that newly (re)started
pod will always update the operator state, preventing stale data
to linger in the galera CR status.

Jira: OSPRH-23075
@openshift-ci

openshift-ci Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dciabrin, lmiccini

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot Bot merged commit a569a68 into openstack-k8s-operators:main Jun 5, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants