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

Add initial watcher api conf generation #27

Conversation

cescgina
Copy link
Contributor

@cescgina cescgina commented Dec 12, 2024

Implement an initial version of watcher config generation. This change
adds a watcher config template and generates a secret with the templated
config. Some fields that require changes in the watcher controller like
the transporturl and memcached servers.

This change also modifies the WatcherAPI functional tests so the
WatcherAPI instances use a different name that the Watcher one, so it's
easier to debug.

Related: OSPRH-11483

Copy link

openshift-ci bot commented Dec 12, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/69a6a581343c4d59884c53128154ddc6

✔️ noop SUCCESS in 0s
✔️ openstack-meta-content-provider SUCCESS in 1h 23m 38s
✔️ watcher-operator-validation SUCCESS in 1h 13m 01s
watcher-operator-kuttl FAILURE in 46m 57s

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/843017e005094e32973188fa06cc2a8a

✔️ noop SUCCESS in 0s
✔️ openstack-meta-content-provider SUCCESS in 1h 22m 39s
✔️ watcher-operator-validation SUCCESS in 1h 12m 19s
watcher-operator-kuttl FAILURE in 45m 42s

@cescgina cescgina force-pushed the watcherapi_generate_config branch 3 times, most recently from a14f1e4 to cfd6038 Compare December 13, 2024 16:26
@cescgina cescgina force-pushed the watcherapi_generate_config branch from cfd6038 to 8e740bf Compare December 17, 2024 10:47
@cescgina cescgina force-pushed the watcherapi_generate_config branch 2 times, most recently from 472a393 to 48a6210 Compare December 17, 2024 15:23
@cescgina cescgina changed the title watcherapi generate config Add initial watcher api conf generation Dec 17, 2024
@cescgina cescgina marked this pull request as ready for review December 17, 2024 15:24
@cescgina cescgina force-pushed the watcherapi_generate_config branch 2 times, most recently from 6584afa to 6562865 Compare December 17, 2024 15:27
templates/watcher/config/00-default.conf Outdated Show resolved Hide resolved
templates/watcher/config/00-default.conf Outdated Show resolved Hide resolved
@cescgina cescgina force-pushed the watcherapi_generate_config branch from 6562865 to d03f0cc Compare December 18, 2024 08:37
api/v1beta1/watcher_types.go Outdated Show resolved Hide resolved
api/v1beta1/watcherapi_types.go Outdated Show resolved Hide resolved
controllers/watcher_common.go Outdated Show resolved Hide resolved
controllers/watcherapi_controller.go Outdated Show resolved Hide resolved
templates/watcher/config/00-default.conf Outdated Show resolved Hide resolved
templates/watcher/config/00-default.conf Outdated Show resolved Hide resolved
@cescgina cescgina force-pushed the watcherapi_generate_config branch 2 times, most recently from 98252f6 to ba040a3 Compare December 18, 2024 09:23
@cescgina cescgina marked this pull request as draft December 18, 2024 09:30
@cescgina
Copy link
Contributor Author

marking it ready for review again, as I added the missing config files (at leas I think I did). I expect the files will need tweak when I create the deployment and they're actually used

Copy link
Contributor

@amoralej amoralej left a comment

Choose a reason for hiding this comment

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

Some minor comments. None of them is blocking for this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Comment for future usage of this config, the openstack-watcher-api package provides already a wsgi file in /usr/bin/watcher-api-wsgi that can be used for the httpd configuration. It has exactly the same content.

There may be a reason to maintain it in the operators (I've seen others are doing the same), but I think it may be worthy to test if we could switch to the wsgi executable provided upstream (which is the one in the packages) instead of keeping it here.

In any case, we can discuss details about configuration later, when creating the deployment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's interesting, I didn't know that. I'll do what you propose, leave this file in, and once I have a working deployment see if we can reuse the existing file

@amoralej
Copy link
Contributor

/lgtm

@cescgina cescgina force-pushed the watcherapi_generate_config branch from 40953e8 to c1ad7d8 Compare December 18, 2024 15:19
@openshift-ci openshift-ci bot removed the lgtm label Dec 18, 2024
Implement an initial version of watcher config generation. This change
adds a watcher config template and generates a secret with the templated
config. Some fields that require changes in the watcher controller like
the transporturl and memcached servers.

This change also modifies the WatcherAPI functional tests so the
WatcherAPI instances use a different name that the Watcher one, so it's
easier to debug.
@cescgina cescgina force-pushed the watcherapi_generate_config branch from c1ad7d8 to c957afb Compare December 18, 2024 16:02
@amoralej
Copy link
Contributor

/lgtm

lock_path = /var/lib/watcher/tmp

[watcher_datasources]
datasources = ceilometer
Copy link

Choose a reason for hiding this comment

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

actually we should not merge with this as Takashi is actually removing with https://review.opendev.org/c/openstack/watcher/+/937625

really we want the default to be prometheus? it is up to the deployer what the default is here i think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's a good point. But considering that prometheus support has not yet landed upstream, if we merge with that, it'll probably cause an error once I create the deployment and the service starts running. Probably the best option for now is leave ceilometer and add a comment explaining the situation and then move the prometheus as soon as we support it

Copy link

Choose a reason for hiding this comment

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

best thing is to leave empty, so strategies will check for all available datasources.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 to go with ceilometer now.

Copy link
Contributor

Choose a reason for hiding this comment

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

WRT:

really we want the default to be prometheus? it is up to the deployer what the default is here i think.

I think we should leave a meaningful default value. In this case, the deployer using openstack-k8s-operators have no option to deploy monasca, gnocchi and will be limited to prometheus, so I think we should default to prometheus.

best thing is to leave empty, so strategies will check for all available datasources.

What I've seen in logs is that, when all the datasources are tried, it tries multiple times (10 by default) with a certain timeout on each one. I think this is a waste of resources for a case where we know (or we will know) that prometheus is really the only available data source (as deployed by operators). So, I'd be prescriptive in the default configuration.

In any case, we are still not running any service and we will have follow-up PRs where we will do the actual deployment. We can retake this discussion by then.

@raukadah
Copy link
Contributor

/lgtm

@amoralej
Copy link
Contributor

/approve

Copy link

openshift-ci bot commented Dec 19, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amoralej

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 3466392 into openstack-k8s-operators:main Dec 19, 2024
6 checks passed
@cescgina cescgina deleted the watcherapi_generate_config branch December 19, 2024 11:33
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.

6 participants