-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #145 from Vinci-C/master
ENH:Created a compose file to deploy a grafana container
- Loading branch information
Showing
4 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
apiVersion: 1 | ||
|
||
datasources: | ||
- name: CloudInfluxDB | ||
type: influxdb | ||
access: proxy | ||
uid: "openstack_grafana" | ||
user: $PROD_INFLUX_USERNAME | ||
url: $PROD_INFLUX_DB_URL | ||
#database: "cloud" # this is a deprecated field but works for v10 | ||
jsonData: | ||
dbName : "cloud" | ||
httpMode: POST | ||
timeInterval: "60" | ||
maxSeries: 200 | ||
secureJsonData: | ||
password: $PROD_INFLUX_PASSWORD | ||
|
||
- name: grafana-power-metrics | ||
type: grafana-opensearch-datasource | ||
access: proxy | ||
uid: "opensearch-grafana" | ||
url: $PROD_OPENSEARCH_URL | ||
basicAuth: true | ||
basicAuthUser: admin | ||
jsonData: | ||
tlsSkipVerify: true | ||
database: "[cloud-ipmi-power-]YYYY.MM.DD" | ||
interval: Daily | ||
timeField: "@timestamp" | ||
version: "2.3.0" | ||
flavor: "opensearch" | ||
secureJsonData: | ||
basicAuthPassword: $PROD_OPENSEARCH_PASSWORD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
services: | ||
grafana: | ||
image: grafana/grafana-oss | ||
container_name: grafana-instance | ||
environment: | ||
- GF_AUTH_GENERIC_OAUTH_CLIENT_ID=$IRIS_CLIENT_ID | ||
- GF_AUTH_GENERIC_OAUTH_CLIENT_SECRET=$IRIS_CLIENT_SECRET | ||
- GF_AUTH_GENERIC_OAUTH_AUTH_URL=https://iris-iam.stfc.ac.uk/authorize | ||
- GF_AUTH_GENERIC_OAUTH_API_URL=https://iris-iam.stfc.ac.uk/userinfo | ||
- GF_AUTH_GENERIC_OAUTH_ENABLED=TRUE | ||
- GF_AUTH_GENERIC_OAUTH_SCOPES=openid profile email | ||
- GF_AUTH_GENERIC_OAUTH_TOKEN_URL=https://iris-iam.stfc.ac.uk/token | ||
- GF_AUTH_GENERIC_OAUTH_GROUPS_ATTRIBUTE_PATH=groups[*] | ||
- GF_AUTH_GENERIC_OAUTH_ALLOWED_GROUPS=stfc-cloud/admins | ||
- GF_AUTH_GENERIC_OAUTH_DOMAIN=$GRAFANA_DOMAIN_NAME | ||
- GF_AUTH_GENERIC_OAUTH_ROOT_URL=$GRAFANA_ROOT_URL | ||
- GF_AUTH_GENERIC_OAUTH_PROTOCOL=http | ||
- GF_AUTH_GENERIC_OAUTH_HTTP_PORT=3000 | ||
- PROD_INFLUX_USERNAME=$PROD_INFLUX_USERNAME | ||
- PROD_INFLUX_PASSWORD=$PROD_INFLUX_PASSWORD | ||
- PROD_OPENSEARCH_PASSWORD=$PROD_OPENSEARCH_PASSWORD | ||
- PROD_INFLUX_DB_URL=$PROD_INFLUX_DB_URL | ||
- PROD_OPENSEARCH_URL=$PROD_OPENSEARCH_URL | ||
- GRAFANA_DOMAIN_NAME=$GRAFANA_DOMAIN_NAME | ||
- GRAFANA_ROOT_URL=$GRAFANA_ROOT_URL | ||
volumes: | ||
- ./cloud_datasource.yaml:/etc/grafana/provisioning/datasources/cloud_datasource.yaml | ||
- ./cloud-grafana-dashboards/:/etc/grafana/provisioning/dashboards |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
export IRIS_CLIENT_ID= | ||
export IRIS_CLIENT_SECRET= | ||
export PROD_INFLUX_USERNAME= | ||
export PROD_INFLUX_PASSWORD= | ||
export PROD_OPENSEARCH_PASSWORD= | ||
export PROD_INFLUX_DB_URL= | ||
export PROD_OPENSEARCH_URL= | ||
export GRAFANA_DOMAIN_NAME= | ||
export GRAFANA_ROOT_URL= | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
All required environment variables can be found in env.sh and should be updated before deploying, environment variables are included in compose.yaml and will be copied to the container | ||
|
||
#compose.yaml | ||
Specifies the image, name, and environment variables used when arranging docker | ||
|
||
#cloud_datasource.yaml | ||
When grafana see this file it makes connection to the databases specified in this file | ||
|
||
#env.sh | ||
Stores environment variables which cannot be published onto github | ||
User should edit and run this script to export the environment variables |