Closed victorock closed 3 years ago
Hello @victorock, thanks for reaching out!
The current structure is tied to the way the OperatorSDK works, you can see the generated scaffold here: https://sdk.operatorframework.io/docs/building-operators/ansible/tutorial/
Can you provide more information regarding your proposal?
@raelga sorry about not clarifying what i meant. I was referring to the ansible content under: roles/prometheusexporter/.
What did you have in mind?
@raelga follow here an example to validate the idea, before going through testing, etc...
I've also integrated some additional content and logic to be able to better handle the lifecycle of the operator itself:
In a case where something goes wrong during the deployment, and we want to specify external/tasks roles to recover...
if we want to trigger pre tasks/roles for scenarios like upgrades...
if we always want to trigger post tasks/external roles helpers...
With this implementation, tasks moved to here, so we avoid accidental changes by users integrating new exporters...
As such, users only care about changing exporters specifications here...
Thanks for the input @victorock, let us review it carefully as there are many changes, and we will get back to you, but the overall looks good!
@victorock your changes look really good, thanks for the improvements.
I can't think right now, for the current operator, an escenario that pre/post task may come helpful who knows. The rest of the changes, makes the code more clean and extensible.
Feel free to push a pull request so we can do a final review and integrate your changes. :)
@victorock, as @raelga said, the overall looks really nice, cleaner and easier to integrate a new exporter. Just a few comments/suggestions before opening the pull request:
prometheusexporter
to prometheus_exporter
, this comes from default operator-sdk
behaviour, and we prefer not doing so:
$operator-sdk init --plugins=ansible --domain=3scale.net
Next: define a resource with:
$ operator-sdk create api
$ operator-sdk create api --group monitoring --version v1 --kind PrometheusExporter --generate-role
$ ll roles/
total 0
drwxr-xr-x 9 slopez slopez 200 Dec 3 11:40 prometheusexporter
Closing issue, it was resolved on https://github.com/3scale-ops/prometheus-exporter-operator/pull/24 where we applied some operator improvements.
Better accommodate exporters.