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

First release - prometheus-exporter operator #1

Merged
merged 8 commits into from Jan 13, 2020
Merged

First release - prometheus-exporter operator #1

merged 8 commits into from Jan 13, 2020

Conversation

@slopezz
Copy link
Member

slopezz commented Jan 2, 2020

Solves internal issue 3scale/platform#42

Main features

  • It has been added first version of prometheus-exporter-operator using operator-sdk v0.13.0 (last available version)
  • At the moment it is an ansible based operator, but the idea is to migrate it to go in the future
  • This operator can be used on Kubernetes or OpenShift
  • Current supported prometheus-exporter type: memcached, redis, mysql, postgresql, sphinx, elasticsearch, cloudwatch
  • Operator manages lifecycle of the following objects for every CR: Deployment, Service and optionally ServiceMonitor
  • Some exporters require previously manually created objects like Secrets for credentials and Configmaps for configuration files

Operator

  • For operator image management, you will need operator-sdk binary, you can get it here
  • To build/push an operator image just run (takes image repository and version from Makefile):
make operator-image-update
  • To deploy operator objects (Namespace, CRD, role, role_binding. service_account, operator deployment):
make operator-create
  • To clean resources:
make operator-delete
  • Deletion of CRD and Namespace is not integrated on the Makefile delete targets for caution:
    • Deletion of Namespace may delete undesired objects on the Namespace that later on may not be reproducible
    • Deletion of CRD (which is an object at cluster level) may caused other possible deployed CRs on different cluster Namespace to fail

Exporters examples

  • On examples directory there is included a secondary Makefile used to deploy examples of each supported prometheus-exporters (including extra needed objects like Secrets/Configmaps, example DBs, example CRs..) and also to manage created objects deletion.
  • All create/delete targets are documented on examples/README, or can be checked with make help
  • All examples of exporters monitoring databases include the deployment of an example database (except sphinx or elasticsearch, where you will need to set a previously available/reachable dbHost/dbPort on its pertinent CR)

GrafanaDashboard/PrometheusRule

  • It has been added examples of grafana dashboards for memcached, redis, mysql, postgresql, sphinx
  • In addition, it has been added examples of prometheus rules for memcached, redis, mysql, postgresql, sphinx (alert thresholds may need to be customized for each case, depending on databases size)
  • In order to test grafana-dashboards and prometheus-rules, it has been used https://github.com/integr8ly/application-monitoring-operator which includes prometheus, alert-manager and grafana operators deployment on Namespace application-monitoring
  • To test them, you just need to be authenticated within a Openshift v.3.11.0+ cluster, and:
git clone https://github.com/integr8ly/application-monitoring-operator.git

make cluster/install
  • On Namespace application-monitoring you will see all created resources, and among them you will see public Route created objects for Prometheus, Grafana and AlertManager.
  • For managing creation/deletion of dashboards/rules, you can use Makefile targets documented on README:
make grafana-dashboards-create
make grafana-dashboards-delete
make prometheus-rules-create
make prometheus-rules-delete
@slopezz slopezz added the enhancement label Jan 2, 2020
@slopezz slopezz requested review from roivaz and raelga Jan 2, 2020
@roivaz

This comment has been minimized.

Copy link

roivaz commented Jan 3, 2020

I have a comment on the directory structure. Why have a deploy dir and then an examples dir? I think is more easy to a potential user if all were under the deploy directory, which is usually what you find in other operator projects.

Same can be said about the grafana-dashboards one, I would include everything under deploy

Makefile Outdated Show resolved Hide resolved
Makefile Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@slopezz slopezz force-pushed the first-release branch 3 times, most recently from 3b7f6ce to 08b7ccc Jan 3, 2020
@slopezz slopezz self-assigned this Jan 7, 2020
@slopezz slopezz force-pushed the first-release branch from 08b7ccc to ad43b57 Jan 7, 2020
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
examples/README.md Outdated Show resolved Hide resolved
examples/README.md Outdated Show resolved Hide resolved
examples/README.md Outdated Show resolved Hide resolved
examples/README.md Outdated Show resolved Hide resolved
examples/README.md Outdated Show resolved Hide resolved
@raelga
raelga approved these changes Jan 10, 2020
@slopezz slopezz force-pushed the first-release branch 2 times, most recently from 1a10f6d to da4dd57 Jan 10, 2020
@roivaz roivaz self-requested a review Jan 13, 2020
@roivaz
roivaz approved these changes Jan 13, 2020
Copy link

roivaz left a comment

/lgtm awesome work!!!

@slopezz slopezz force-pushed the first-release branch from da4dd57 to 77f14da Jan 13, 2020
@slopezz slopezz merged commit 618033a into master Jan 13, 2020
@slopezz slopezz deleted the first-release branch Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.