38 Commits

Author SHA1 Message Date
Zuul
8f70bc22d6 Merge "Add extra volumes support for services that were not previously supported" 2019-08-05 09:02:04 +00:00
Mark Goddard
de00bf491d Simplify handler conditionals
Currently, we have a lot of logic for checking if a handler should run,
depending on whether config files have changed and whether the
container configuration has changed. As rm_work pointed out during
the recent haproxy refactor, these conditionals are typically
unnecessary - we can rely on Ansible's handler notification system
to only trigger handlers when they need to run. This removes a lot
of error prone code.

This patch removes conditional handler logic for all services. It is
important to ensure that we no longer trigger handlers when unnecessary,
because without these checks in place it will trigger a restart of the
containers.

Implements: blueprint simplify-handlers

Change-Id: I4f1aa03e9a9faaf8aecd556dfeafdb834042e4cd
2019-06-27 15:57:19 +00:00
ZijianGuo
e610a73e98 Add extra volumes support for services that were not previously supported
We don't add extra volumes support for all services in patch [1].
In order to unify the management of the volume, so we need add extra volumes
support for these services.

[1] 12ff28a693

Change-Id: Ie148accdd8e6c60df6b521d55bda12b850c0d255
Partially-Implements: blueprint support-extra-volumes
Signed-off-by: ZijianGuo <guozijn@gmail.com>
2019-06-27 18:32:15 +08:00
Mark Goddard
b123bf6621 Use become for all docker tasks
Many tasks that use Docker have become specified already, but
not all. This change ensures all tasks that use the following
modules have become:

* kolla_docker
* kolla_ceph_keyring
* kolla_toolbox
* kolla_container_facts

It also adds become for 'command' tasks that use docker CLI.

Change-Id: I4a5ebcedaccb9261dbc958ec67e8077d7980e496
2019-06-06 19:04:58 +01:00
Doug Szumski
9d495504be Set external web URL for Prometheus services
This change ensures that URLs returned from these services reference
the HAProxy endpoint, rather than the host on which the service is
running.

Closes-Bug: #1825150
Change-Id: I7f966ff749ea37620f1bde7019a598cb9505fa45
2019-04-17 11:24:52 +01:00
dommgifer
a174cfad17 Add become for prometheus-openstack-exporter tasks
Add become to copy cloud config file for openstack exporter.

Change-Id: I4c0c325e9dd1f41ca2c4667178a4fa674fa23ec5
Closes-Bug: #1824098
2019-04-10 16:42:11 +08:00
Mark Goddard
a4bb8567da Fix up config file permissions on the host
Several config file permissions are incorrect on the host. In general,
files should be 0660, and directories and executables 0770.

Change-Id: Id276ac1864f280554e98b937f2845bb424d521de
Closes-Bug: #1821579
2019-04-02 17:23:31 +01:00
Doug Szumski
5b4e487699 Standardise Prometheus install type
All Prometheus services should use the Prometheus install type which
defaults to the Kolla install type, rather than directly using the
Kolla install type.

Change-Id: Ieaa924986dff33d4cf4a90991a8f34534cfc3468
2019-03-18 13:26:15 +00:00
Erol Guzoglu
14ab9a7c4e Support the prometheus elasticsearch exporter
This patch implements the support for the elasticsearch-exporter in
kolla-ansible

The configuration and prechecks are reused from the other exporters

Depends-On: Id138f12e10102a6dd2cd8d84f2cc47aa29af3972
Change-Id: Iae0eac0179089f159804490bf71f1cf2c38dde54
2019-03-11 17:25:51 +03:00
Zuul
b6f1ffcc72 Merge "Update arguments for starting Prometheus exporters" 2019-03-04 16:31:39 +00:00
Doug Szumski
e8f6a4aa14 Use prometheus tag for OpenStack exporter
Change-Id: Idd570626851c068b9a2daf3f1550346d419f9c9b
2019-03-01 12:45:40 +00:00
Doug Szumski
a55769b00a Update arguments for starting Prometheus exporters
The patch that this depends on in the Kolla repo updates various Prometheus
exporters. In some cases the command line syntax has changed which prevents
them from starting. This commit updates the command line syntax in-line with
the new versions.

Depends-On: I846989b16fa7f76b11b309b7a9764cec8aaf538d
Change-Id: I1c8c56059e51442d7bf2248b9632021cb529b4ba
2019-02-28 09:41:32 +00:00
Doug Szumski
4aed04409b Default to Prometheus tag for all Prometheus images
This allows an operator to pin the Prometheus docker image
tag for all Prometheus images to that specified by the `prometheus_tag`.
Without this change, the alert manager and cadvisor tags would also need
to be set.

Change-Id: Iadef001af7d3be5b2a39ce5e2363d05a33a775e4
2019-02-27 13:59:46 +00:00
Jorge Niedbalski
6c64b7c732 [prometheus] Support the prometheus openstack exporter
This patch implements the initial support for the
openstack-exporter[0] in the kolla-ansible
prometheus monitoring system.

The configuration and prechecks are reused from the other
exporters and a new template is provided for generating
a os-client-config file required by the exporter.

The default scrape interval is 60 seconds, but it can
be extended via a configuration option.

[0] https://github.com/Linaro/openstack-exporter

Change-Id: I4a34c4bb56e74b5cd544972cbd6540d9acb6e4a1
2019-01-21 10:41:35 -03:00
Dai, Dang Van
8d5355dbc1 Fix bootstrap prometheus container location
This change to fix the case that
I won't use prometheus-mysqld-exporter

Change-Id: I1936bbae0172f4e65605d71066dced837bc30f7a
2018-12-27 12:46:22 +00:00
dommgifer
69823f8692 Add become for Prometheus configuration tasks
This is required to support execution as a non-root user.

Change-Id: I60d224407c2828d6b9f1701f7637385a25fbcced
Closes-Bug: #1809233
2018-12-21 16:59:18 +08:00
Pavel Sinkevych
0c8b4730af Fix prometheus prechecks for haproxy and memcached
Add missing `prometheus_memcached_exporter` container_fact
Fix conditional container_fact for haproxy_exporter

Change-Id: Id0f3b94af956f51e3c782c0244c6ce7a340119bd
Closes-Bug: #1808820
2018-12-17 18:03:34 +03:00
Kien Nguyen
835368524e Add Prometheus as Vitrage datasource
Vitrage has already supported Prometheus as
datasource. Kolla can config it automatically,
just need a little changes, for example in
wsgi config file [1].

Co-Authored-By: Hieu LE <hieulq2@viettel.com.vn>

[1] https://review.openstack.org/#/c/584649/8/devstack/apache-vitrage.template

Change-Id: I64028a0dfd9887813b980a31c30c2c1b1046da61
2018-12-11 16:05:05 +07:00
Eduardo Gonzalez
1a682fab28 Support stop specific containers
With this change, an operator may be able to stop a
service container without stopping all services in a host.
This change is the starting point to start
fast-forward upgrades support.
In next changes new flags will be introducced to disable
stop dataplane services during upgrades.

Change-Id: Ifde7a39d7d8596ef0d7405ecf1ac1d49a459d9ef
Implements: blueprint support-stop-containers
2018-11-26 08:07:01 +00:00
Doug Szumski
9d8a5a1a8c Add missing pid mode check for Prometheus
Trivial-Fix
Change-Id: Iea123c32981309698bd644229dc1525fa671a487
2018-10-30 16:34:15 +00:00
Adam Harwell
f1c8136556 Refactor haproxy config (split by service) V2.0
Having all services in one giant haproxy file makes altering
configuration for a service both painful and dangerous. Each service
should be configured with a simple set of variables and rendered with a
single unified template.

Available are two new templates:

* haproxy_single_service_listen.cfg.j2: close to the original style, but
only one service per file
* haproxy_single_service_split.cfg.j2: using the newer haproxy syntax
for separated frontend and backend

For now the default will be the single listen block, for ease of
transition.

Change-Id: I6e237438fbc0aa3c89a3c8bd706a53b74e71904b
2018-09-26 03:30:38 -07:00
Ha Manh Dong
79da68fab6 Fix missing slash at mount volumes for prometheus-cadvisor
Change-Id: I0444b23aee900d028c879ec64d153d59a18ff504
2018-09-25 10:41:42 +07:00
Mark Goddard
354894e2e9 Add check.yml for prometheus and vitrage
Without this, kolla-ansible check fails with the following error:

Unable to retrieve file contents
Could not find or access '/path/to/kolla-ansible/ansible/check.yml'"}

Also adds the check command to the CI tests, to ensure that it does not
break again.

Change-Id: I9fc2f9999f55cb742ac3ac38579dcf26524a9fc7
Closes-Bug: #1790653
2018-09-04 15:36:34 +01:00
Zuul
3f14a99f2a Merge "[prometheus] Allow custom alert rules to be configured." 2018-08-30 11:57:11 +00:00
Zuul
cfee876895 Merge "[prometheus] Enable ceph mgr exporter" 2018-08-30 07:09:48 +00:00
Jorge Niedbalski
0ec41f2092 [prometheus] Allow custom alert rules to be configured.
This patch extends the configuration task for prometheus
to allow the operator to pass a(set) of prometheus alert
rules files, that will be used by alertmanager to produce
alerts.

This functionality is only enabled when the prometheus-alertmanager
service is enabled.

Change-Id: I882759c3774f43640631c1058f8a9cb24e7a60d2
Closes-Bug: #1776529
Signed-off-by: Jorge Niedbalski <jorge.niedbalski@linaro.org>
2018-08-08 12:48:41 -04:00
Jorge Niedbalski
19ec40170f [prometheus-alertmanager] use template/first_found instead of merge_yaml.
Change https://review.openstack.org/#/c/571826/4/
introduced the usage of merge_yaml for rendering the
prometheus-alertmanager.yml configuration.

However the merge_yaml module doesn't do a deep copy of >=
second level properties, so it doesn't works for
most configurations.

Bug: #1786077
Change-Id: I35297c6e2a3800582fb1fd3782a5d93558562b1d
Signed-off-by: Jorge Niedbalski <jorge.niedbalski@linaro.org>
2018-08-08 12:32:24 -04:00
Zuul
3e45b2cbec Merge "Use include_tasks instead of include" 2018-07-27 08:16:08 +00:00
Jeffrey Zhang
b51eeed89e Use include_tasks instead of include
include is marked as deprecated since ansible 2.4[0]

[0] https://docs.ansible.com/ansible/2.4/include_module.html#deprecated

Co-Authored-By: confi-surya <singh.surya64mnnit@gmail.com>
Change-Id: Ic9d71e1865d1c728890625aeddf424a5734c0a8a
2018-07-25 23:57:22 +08:00
Lakshmi Prasanna Goutham Pratapa
9f0db30fd1 Apply Resource-Constraints to all services.
This commit is the final commit to apply resource-constraints
to all OpenStack services.

Depends-on: I39004f54281f97d53dfa4b1dbcf248650ad6f186
Change-Id: I072d69be9698be54775cb0ae286ea2b6ed78776c
Implements: blueprint resource-constraints
2018-07-23 19:07:05 +05:30
Jorge Niedbalski
9d2770db11 [prometheus] Enable ceph mgr exporter
This patch enables the ceph mgr prometheus exporter.

If enable_prometheus_ceph_mgr_exporter is set to true,
the ceph mgr prometheus plugin is enabled on the hosts that are part
of the ceph-mgr group, then the exporter is added into the prometheus-server
configuration file.

Change-Id: Ia2f879401e585e6043f69cc5e3ab1a1f72f7f033
2018-07-23 05:39:52 +00:00
Jorge Niedbalski
1596475db6 [prometheus] Initial implementation of prometheus-alertmanager
This patch extends the prometheus role for being able
to deploy the prometheus-alertmanager[0] container.

The variable enable_prometheus_alertmanager
decides if the container should be deployed and enabled.

If enabled, the following configuration and actions are performed:

- The alerting section on the prometheus-server configuration
is added pointing the prometheus-alertmanager host group as targets.

- HAProxy is configured to load-balance over the prometheus-alertmanager
host group. (external/internal).

Please note that a default (dummy) configuration is provided, that
allows the service to start, the operator should extend it via a node custom config

[0] https://github.com/openstack/kolla/tree/master/docker/prometheus/prometheus-alertmanager

Change-Id: I3a13342c67744a278cc8d52900a913c3ccc452ae
Closes-Bug: 1774725
Signed-off-by: Jorge Niedbalski <jorge.niedbalski@linaro.org>
2018-07-11 16:20:35 -04:00
Ha Manh Dong
30be04ea91 Specify 'become' for all tasks that use kolla_docker module
Add become to all tasks that use the module "kolla_docker"

Change-Id: I4309c4011687b88ec31d739fd8f834fe2326ff10
Partial-Implements: blueprint ansible-specific-task-become
2018-06-08 12:39:24 +00:00
Mark Giles
41254b6c46 Add cAdvisor for Prometheus monitoring
cAdvisor (Container Advisor) provides metrics on resource usage and
performance characteristics of running containers.  This change
deploys a cadvisor container and configures prometheus to scrape
data from it.

Change-Id: I55dd4fee954f9be68efda397746861ddaaa0a565
Partially-Implements: blueprint prometheus
2018-05-29 08:55:58 -04:00
Jorge Niedbalski
3b61cc702d [prometheus] Add memcached_exporter.
This patch adds the prometheus_memcached_exporter[0] to the
list of  available exporters, following the conventions
used by the previously integrated exporters.

[0] https://github.com/openstack/kolla/tree/master/docker/prometheus-memcached-exporter

Change-Id: I103b0ee19ef2fd17ce19a27d60773675ad234c1c
Closes-Bug: #1773303
Signed-off-by: Jorge Niedbalski <jorge.niedbalski@linaro.org>
2018-05-25 01:45:13 -04:00
Mark Goddard
2e190597bb Fix missed kolla_action and kolla_serial
In change I78cb60168aaa40bb6439198283546b7faf33917c, action was changed
to kolla_action, and serial to kolla_serial, to avoid Ansible warnings
due to use of reserved keywords. In that change, some keywords were
missed, and some changes that were merged since then have not switched
to the new variables. This change fixes all current instances of those
issues.

Change-Id: I357dffdfcb2b405e280a962d366ee65eebf0a8d1
Implements: blueprint migrate-to-ansible-2-2-0
2018-05-16 13:13:06 +01:00
ZhijunWei
bca297b948 Fix the prechecks action for prometheus_server
the prometheus container is not exits, it should be
prometheus_server[0]

[0]: https://github.com/openstack/kolla-ansible/blob/master/ansible/roles/prometheus/defaults/main.yml#L6

Change-Id: Ib44390af9b8af5156dafbd0b0da6ae061a926ec7
2018-04-29 08:12:48 +00:00
Mathias Ewald
4d1f37359d Add role to deploy prometheus
This patch adds the ansible role to deploy the prometheus service which
can be used to collect performance metrics accross the environment

Partially-Implements: blueprint prometheus
Change-Id: I908b9c9dad63ab5c9b80be1e3a80a4fc8191cb9e
2018-04-19 10:58:15 -04:00