Commit Graph

149 Commits

Author SHA1 Message Date
Ritchie, Frank (fr801x) 6df0925b25 Make selenium v4 syntax optional
Make selenium v4 syntax optional using the same pattern as

https://review.opendev.org/c/openstack/openstack-helm-infra/+/892708

See:

https: //review.opendev.org/c/openstack/openstack-helm-infra/+/883894/5/grafana/templates/bin/_selenium-tests.py.tpl
Change-Id: I744b721750c474db9fecbd46280d30cfb8347a6f
2023-08-30 16:10:44 -04:00
Vladimir Kozhukalov 2e59208351 Fix grafana job deployment condition
The run migrator job should be deployed
if .Values.manifests.job_run_migrator is true

story: 2010696
task: 47809
Change-Id: I5717d8c6c2de270268a0e14ee4b8abb7969b07bb
2023-06-08 16:02:36 +03:00
astebenkova 92d16f3a29 [osh-selenium] Upgrade image to latest-ubuntu_focal
+ migrate all Python tests to use Selenium v4 (bionic image had v3 installed):
https://www.selenium.dev/documentation/webdriver/getting_started/upgrade_to_selenium_4/
+ amend selenium role in order to install ChromeDriver compatible with Google Chrome:
https://chromedriver.chromium.org/downloads/version-selection
+ run selenium tests AFTER the charts are deployed

Change-Id: I46200b7dc173bd0e1e6bf3545d9a26c252a21927
2023-05-23 18:09:16 +03:00
Ritchie, Frank (fr801x) 150dcdcf9a Update grafana version to 9.2.10
This PS is just to update grafana to 9.2.10.

Change-Id: I4958ef802653d9523bfdcdff0a709042794dba8c
2023-02-27 15:47:53 -05:00
Markin, Sergiy 00846e2e02 [grafana] Migrator job is mariadb-fail-proof
The main goal of this PS is to make sure the migrator can complete the migrations even if mariadb galera cluster dropped the migrator connection leaving the database in inconsistent state. It may happen that migration_log has a record of a successfully performed migration while the database scheme misses an entity so any further attempts to re-run the migrator fail because of missed entity the migrator expects to be present.

Also the migrator is running mariadb image as a main one and grafana binaries are mounted as /usr/share/grafana. Migrator job container is running under nobody user uid.

This PS runs migrator in a safe way:
- prepares database backup
- runs a single instance of grafana as migrator with log file as a background process in a loop
- constantly checks the log file in the main process
- in case of the migrations completed it stops grafana-server process and completed the job
- in case of a migration error it restores the previously prepared backup so the grafana-server that is running in a background loop can re-try the migration
- the database operations are prefixed with code that makes sure the database is reachable.

Change-Id: I4e1542b62777f25c08ddd2cb74f0a0e7bfea5145
2023-01-05 10:27:37 -06:00
vs422h (Vladimir Sigunov) 8232476426 [Grafana] Fix uid for the grafana user
The correct uid for the grafana user is 472 (see official docs).

Change-Id: I54c210e21ae2f10c9f0929764466d3c504b777ce
2022-12-28 14:12:48 -05:00
Ritchie, Frank (fr801x) 818c475f1d Grafana 8.5.10 with unified alerting
This PS updates Grafana to 8.5.10 and enables unified alerting
which will be the default in 9.x.

The following directories are required for unified alerting:
/var/lib/grafana/alerting
/var/lib/grafana/csv

If a user is upgrading from Grafana 7.x and wants to opt out of unified
alerting they will need to set:

[alerting]
enabled = true
[unified_alerting]
enabled = false

in grafana.ini. Additionally, to roll back, the env var

GF_DEFAULT_FORCE_MIGRATION: true

needs to be set for the grafana_run_migrator pod.

Unified alerting doc:

https://grafana.com/docs/grafana/v9.0/alerting/migrating-alerts/

Change-Id: I3a6ca005b9d9433e958802e7e978b81479a16fb8
2022-09-08 10:40:27 -04:00
Brian Haley f31cfb2ef9 support image registries with authentication
Based on spec in openstack-helm repo,
support-OCI-image-registry-with-authentication-turned-on.rst

Each Helm chart can configure an OCI image registry and
credentials to use. A Kubernetes secret is then created with these
info. Service Accounts then specify an imagePullSecret specifying
the Secret with creds for the registry. Then any pod using one
of these ServiceAccounts may pull images from an authenticated
container registry.

Change-Id: Iebda4c7a861aa13db921328776b20c14ba346269
2022-07-20 14:28:47 -05:00
Ruslan Aliev e99dfc1c84 Add run migrator job prior running grafana pods
During the first run, grafana will run migrator job, which populates
necessary fields in database. Previously, if there are two or more
grafana pods which start up simultaneously, it causes the race condition
for database access and finally one of the pods will fail (in some
cases both of them), leaving the grafana database in incomplete state.

Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Change-Id: I5a7993b3cad2d48af3f73218d6c61c216520e1c5
2022-06-14 21:31:33 -05:00
Ritchie, Frank (fr801x) c0282d430c Rename prometheus metric
The metric ceph_pool_bytes_used has changed to ceph_pool_stored.

https: //tracker.ceph.com/issues/39932
Change-Id: Iab5cf2b318ce538e72b4592dedd8f0e489741797
2022-02-08 11:24:32 -06:00
Lo, Chi (cl566n) 92818273e3 Added Grafana iDRAC dashboard
This patchset also refactor the handling of dashboards yaml
files so that multiple configmaps, grouped by functionality
will be created.

Change-Id: I9849e2a2744e1d2ae895d3e18647b9b3a1c38b12
2021-11-10 21:04:23 +00:00
Gage Hugo 22e50a5569 Update htk requirements
This change updates the helm-toolkit path in each chart as part
of the move to helm v3. This is due to a lack of helm serve.

Change-Id: I011e282616bf0b5a5c72c1db185c70d8c721695e
2021-10-06 01:02:28 +00:00
Sean Eagan b1a247e7f5 Helm 3 - Fix Job labels
If labels are not specified on a Job, kubernetes defaults them
to include the labels of their underlying Pod template. Helm 3
injects metadata into all resources [0] including a
`app.kubernetes.io/managed-by: Helm` label. Thus when kubernetes
sees a Job's labels they are no longer empty and thus do not get
defaulted to the underlying Pod template's labels. This is a
problem since Job labels are depended on by
- Armada pre-upgrade delete hooks
- Armada wait logic configurations
- kubernetes-entrypoint dependencies

Thus for each Job template this adds labels matching the
underlying Pod template to retain the same labels that were
present with Helm 2.

[0]: https://github.com/helm/helm/pull/7649

Change-Id: I3b6b25fcc6a1af4d56f3e2b335615074e2f04b6d
2021-09-30 16:01:31 -05:00
Lo, Chi (cl566n) 5a290e1d83 Add Alertmanager dashboard to Grafana
This patch set adds a new Alertmanager dashboard to Grafana.  Note
that a new configmap is created for this instead of using the
same configmap which includes all the dashboards. Using the same
configmap will eventually run into issue with configmap size limitation.

Change-Id: I10561c0b0b464c3b67d4a738f9f2cb70ef601b3d
2021-08-02 16:05:47 -07:00
Thiago Brito 5a0ba49d50 Prepending library/ to docker official images
This will ease mirroring capabilities for the docker official images.

Signed-off-by: Thiago Brito <thiago.brito@windriver.com>
Change-Id: I0f9177b0b83e4fad599ae0c3f3820202bf1d450d
2021-06-02 15:04:38 -03:00
Pai, Radhika bfeb4255a0 Update Grafana version and Selenium script
This ps updates the version to 7.4.5
The css element in GUI has changed in the new Grafana version , so updated
 the selenium script to find the right element.

Change-Id: I972fddf73719fb5bef821679a5ab07491edf55ff
2021-05-18 15:01:16 -05:00
Lo, Chi (cl566n) 181cbf5599 Secure ingress path for Grafana and Kibana
The change enables TLS for the ingress path of
Grafana and Kibana.

Change-Id: I1bca5a3d78421873bff275d315ec0cca6682a498
2021-05-12 08:50:28 -07:00
Lo, Chi (cl566n) 86112314ed Enable TLS between Prometheus and Grafana
This patchset enables TLS path between Prometheus and Grafana.
Grafana pull data from Prometheus. As such, Prometheus is the
server and Grafana is the client for TLS handshake.

Change-Id: I50cb6f59472155415cff16a81ebaebd192064d65
2021-03-18 02:12:16 +00:00
Lo, Chi (cl566n) 87e3a02dd5 Enable TLS for grafana
This patchset updates grafana chart manifests to enable TLS with
osh-infra mariadb.  TLS for osh-infra mariadb is completed as part
of TLS phase 1, no additional mariadb chart work is required to
work with this patch.

Change-Id: Ic01e7c012ab2167d59b2117eb985386666f2bb2a
2021-03-01 12:21:31 -08:00
Pai, Radhika (rp592h) d5fb81b7f7 [Update] Grafana: Provision any dashboard as homepage
Grafana v7.3 has ability to add the customized dashboard as homepage.
This removes the necessity to have explicit job to add a homepage.

Clean up the explicit add_home-dashboard job.

Change-Id: I68baa7693f545e2d91dba01ae61b4bdae8a26bee
2021-02-24 09:28:15 -06:00
Meghan 0e66ef972a Update Grafana version
This brings the Grafana version up to the current version
and fixes the selenium helm and gate test for the new login
dashboard.

Change-Id: I0b65412f4689c763b3f035055ecbb4ca63c21048
2021-01-19 12:36:59 -08:00
Andrii Ostapenko 1532958c80
Change helm-toolkit dependency version to ">= 0.1.0"
Since we introduced chart version check in gates, requirements are not
satisfied with strict check of 0.1.0

Change-Id: I15950b735b4f8566bc0018fe4f4ea9ba729235fc
Signed-off-by: Andrii Ostapenko <andrii.ostapenko@att.com>
2020-09-24 12:19:28 -05:00
Mohammed Naser c7a45f166f Run chart-testing on all charts
Added chart lint in zuul CI to enhance the stability for charts.
Fixed some lint errors in the current charts.

Change-Id: I9df4024c7ccf8b3510e665fc07ba0f38871fcbdb
2020-09-11 18:02:38 +03:00
Andrii Ostapenko ed1cc58de0 Unpin nagios, osh-selenium and heat images for grafana and nagios
Change-Id: I28a314da6e08f5555b7e68a4ad9f8c1802fde9ca
Signed-off-by: Andrii Ostapenko <andrii.ostapenko@att.com>
2020-07-22 15:10:22 +00:00
KHIYANI, RAHUL (rk0850) a43f479e6c Fix application name for grafana session sync
Implement helm-toolkit snippet for grafana add-home-dashboard
which adds security context template at pod/container

Change-Id: I12a5fd6c5043079f830eb36043f5b0ca495a3e93
2020-07-07 16:50:41 -05:00
Andrii Ostapenko 824f168efc Undo octal-values restriction together with corresponding code
Unrestrict octal values rule since benefits of file modes readability
exceed possible issues with yaml 1.2 adoption in future k8s versions.
These issues will be addressed when/if they occur.

Also ensure osh-infra is a required project for lint job, that matters
when running job against another project.

Change-Id: Ic5e327cf40c4b09c90738baff56419a6cef132da
Signed-off-by: Andrii Ostapenko <andrii.ostapenko@att.com>
2020-07-07 15:42:53 +00:00
Andrii Ostapenko 83e27e600c Enable key-duplicates and octal-values yamllint checks
With corresponding code changes.

Change-Id: I11cde8971b3effbb6eb2b69a7d31ecf12140434e
2020-06-17 13:14:30 -05:00
Andrii Ostapenko 8f24a74bc7 Introduces templates linting
This commit rewrites lint job to make template linting available.
Currently yamllint is run in warning mode against all templates
rendered with default values. Duplicates detected and issues will be
addressed in subsequent commits.

Also all y*ml files are added for linting and corresponding code changes
are made. For non-templates warning rules are disabled to improve
readability. Chart and requirements yamls are also modified in the name
of consistency.

Change-Id: Ife6727c5721a00c65902340d95b7edb0a9c77365
2020-06-11 23:29:42 -05:00
Andrii Ostapenko 731a6b4cfa Enable yamllint checks
- document-end
- document-start
- empty-lines
- hyphens
- indentation
- key-duplicates
- new-line-at-end-of-file
- new-lines
- octal-values

with corresponding code adjustment.

Change-Id: I92d6aa20df82aa0fe198f8ccd535cfcaf613f43a
2020-05-29 19:49:05 +00:00
diwakar thyagaraj 163c5aa780 Enable Apparmor to all osh-infra test pods
Also Changed container names to static.

Change-Id: I51f53b480d18aaa38a9707429f01052ee122e7e9
Signed-off-by: diwakar thyagaraj <diwakar.chitoor.thyagaraj@att.com>
2020-05-19 15:36:07 +00:00
Gage Hugo d14d826b26 Remove OSH Authors copyright
The current copyright refers to a non-existent group
"openstack helm authors" with often out-of-date references that
are confusing when adding a new file to the repo.

This change removes all references to this copyright by the
non-existent group and any blank lines underneath.

Change-Id: I1882738cf9757c5350a8533876fd37b5920b5235
2020-05-07 02:11:15 +00:00
diwakar thyagaraj aaeb0b1abb Enable Apparmor to Grafana Completed pods
This also adds init containers.

Change-Id: Ia70db208a1583b9a44a32d9a3d485ca7dc8a3ce2
Signed-off-by: diwakar thyagaraj <diwakar.chitoor.thyagaraj@att.com>
2020-05-05 15:59:22 +00:00
Radhika Pai 20aad64409 [Update] Grafana: add home dashboard script
Adding a loop to wait for the grafana dashboard to be up and contain the
OSH Home dashboard before running the script.
This should resolve the job completing before the OSH Home dashboard is
in the grafana pod.

Change-Id: I7ab20fad3ce7f7216e2b2679d863f02f97ef1ff4
2020-03-12 14:08:35 -05:00
Radhika Pai dc9e435abb Grafana: Change to import the dashboards in json raw format
This code change is to enable grafana to use the raw json format
dashboards . This is to avoid the conversion of dashboards from json to
yaml and back to json during which the format is encountering issue.
Also this will help in adding new dashboards and maintaining the old
ones.
All the exisiting dashboards under values_override folder are updated to
use raw json format.

Change-Id: I48a7db1514857e082cecbb3b57deff9174509601
2020-03-04 09:52:36 -06:00
Radhika Pai b0bb378a3c Grafana: Provision to add customized HomePage
This code will help to add any customized dashboard as a Home Page for
Grafana. The add_home_dashboard script will be executed after the
Grafana is deployed which sets a new Dashboard(OSH Home) as a landing
Page for a specific Organization.

Change-Id: I32b6b9cad4eaefe7d153cae797d3b3143be5c49b
2020-02-26 10:00:21 -06:00
dt241s@att.com cc392aaa85 Add Apparmor to Grafana
Added apparmor feature gate and Zuul Gate Job

Change-Id: I9ce522f77447b1cb3f189ab7023c5c711e577618
2020-02-25 19:25:12 +00:00
Pai, Radhika (rp592h) 370111ee48 Grafana: Updated the ceph OSD expression
In Ceph Cluster Dashboard the OSDs In, OSDs Out, OSDs Down Panel was
showing wrong values. Updated
the expression from "count" to "sum" to show the correct values.

Change-Id: I1959eeb445bf297c1ec696f3867315f05552b03e
2020-01-10 04:45:27 +00:00
Steve Wilkerson 3a6df3b544 Grafana: Remove default dashboards from chart
This removes the default dashboards from the Grafana chart and
instead places them in the values_overrides directory, similar to
what was done for the Prometheus rules. As Grafana dashboards
will likely be heavily dependent upon end-user needs, the old
default dashboard configs should only be used as a reference
instead of opinionated defaults that are difficult to override.
The previous defaults made using specialized labels for dashboard
variables difficult, as they were making dangerous assumptions
about deployed namespaces and host fqdns. By removing the defaults
entirely, end users can define their own dashboards to meet their
specialized needs

Change-Id: I7def8df68371deda0b75a685363c8a73b818dd45
Signed-off-by: Steve Wilkerson <sw5822@att.com>
2019-12-09 13:39:13 +00:00
Steve Wilkerson 97e029e606 Grafana: Support multiple datasources
This updates the Grafana chart to support the definition of
multiple datasources. This moves to defining a template in the
chart's values.yaml file that allows for inline gotpl for
defining an arbitrary number of datasources. This also updates the
grafana dashboards to include a selector for the Prometheus
datasource to use via a drop down selector. This is vetted out in
the federated monitoring job

Change-Id: I55171fed5c2b343130d135d0b42bc96ff11c4712
Signed-off-by: Steve Wilkerson <sw5822@att.com>
2019-11-22 14:45:04 +00:00
Zuul 2b3d3ef131 Merge "Move charts off using the :latest built tags" 2019-11-21 21:34:04 +00:00
Steve Wilkerson cbeb7f149b Move charts off using the :latest built tags
This updates charts that consume images built from osh-images to
use tags other than the :latest tags. This will be followed up
with the definition of jobs to allow for vetting out of updated
images, as reliance on :latest tags assumes any change merged into
osh-images will result in functionally correct behavior (which has
shown to not be the case traditionally)

Change-Id: I181aa56ed187604dc7583d8081e53cc69eb27310
Signed-off-by: Steve Wilkerson <sw5822@att.com>
2019-11-21 19:57:07 +00:00
Steve Wilkerson a4816feda2 Grafana: Add support for arbitrary environment variables
This updates the Grafana chart to support the definition of
arbitrary environment variables to support scenarios where
additional information may be required at runtime for things like
datasource and dashboard provisioning

Change-Id: I95e4abe9030116a440c6d78a1d14dbcaaf743b40
Signed-off-by: Steve Wilkerson <sw5822@att.com>
2019-11-21 12:40:04 +00:00
Zuul 3e18a436d2 Merge "Grafana: Update version" 2019-11-19 20:50:37 +00:00
Zuul 029f94a776 Merge "Grafana - Update cadvisor labels for k8s 1.16" 2019-11-18 20:55:10 +00:00
Steve Wilkerson 1bfa091203 Grafana: Update version
This updates the Grafana version deployed by default from 5.0.0 to
6.2.0

Change-Id: I39b5405cc3f3fe7754ed6544a8388ff912a4ef58
Signed-off-by: Steve Wilkerson <sw5822@att.com>
2019-11-18 08:49:38 -06:00
Bharat Khare ab95e311a3 Grafana - Update cadvisor labels for k8s 1.16
This patch set will implement the grafana metrics related changes
required for kubernetes version upgrade to 1.16. Updates are mostly
specific to cadvisor metric labels. It is to make sure all
existing metrics are scraped and available in Prometheus so that
these can be consumed by Grafana & Nagios.

Change-Id: I74369ac49dd3f7d9f3682dd5318a3818a4d3f178
2019-11-11 17:57:09 +00:00
Zuul c90ffb11f9 Merge "Grafana gridPos y key resolves true in chart json" 2019-11-11 09:42:13 +00:00
Bharat Khare 020a9d9593 Grafana gridPos y key resolves true in chart json
This change is to fix the issue where Kubernetes Calico dashboard
is not loading in grafana dashboard.
Found the behavior that YAML reserved keys like yes/no/y/n evaluate
to true and false in Ruby hash,so the gridPos key like 'y:' converts
to 'true:' in charts json causing the dashbaord not loading.
Hence updating gridPos panel key (y:) by wrapping it with quotes
like ('y':) to resolve the issue.
There's actually a long list of YAML reserved words with this
behavior like below-
y|Y|yes|Yes|YES|n|N|no|No|NO
|true|True|TRUE|false|False|FALSE
|on|On|ON|off|Off|OFF

Change-Id: I56b01f1312efa8de90def349518c618affb5de85
2019-10-21 14:58:58 +00:00
Steve Wilkerson b50fae62a4 Update kubernetes-entrypoint image reference
This updates the kubernetes-entrypoint image reference to consume
the publicly available kubernetes-entrypoint image that is built
and maintained under the airshipit namespace, as the stackanetes
image is no longer actively maintained

Change-Id: I5bfdc156ae228ab16da57569ac6b05a9a125cb6a
Signed-off-by: Steve Wilkerson <sw5822@att.com>
2019-10-18 18:20:11 +00:00
Steven Fitzpatrick 998885c330 Update Grafana Helm test to use python3
This change updates the selenium_tests container image
to one which installs python3.

The selenium-test.py template file has been refactored
to match the structure of the selenium tests in
/tools/gate/selenium

Depends on: https://review.opendev.org/688436
Change-Id: I4ece5c71df18c21f0cdff536140f63881ff24e30
2019-10-17 11:39:26 -05:00