Skip to content

Commit

Permalink
Added Thanos for multi-cluster in dashbord
Browse files Browse the repository at this point in the history
Signed-off-by: cloudbehl <[email protected]>
  • Loading branch information
cloudbehl committed Oct 19, 2023
1 parent 138b293 commit b4bbc49
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 3 deletions.
68 changes: 68 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
CEPH_IMAGE=rhcsdashboard/ceph-rpm:main
CEPH_REPO_DIR=/home/ankushbehl/work/ceph/ceph
CEPH_PROXY_HOST_PORT=4200
CEPHDASHBOARD_URL_HOST_PORT=11000
# Optional: a custom build directory other than default one ($CEPH_REPO_DIR/build)
CEPH_CUSTOM_BUILD_DIR=
CEPH_E2E_IMAGE=rhcsdashboard/ceph-e2e:nautilus

CEPH_CONTAINER_CPUS=
CEPH_CONTAINER_MEM_LIMIT=

HOST_CCACHE_DIR=

GRAFANA_HOST_PORT=3000
#GRAFANA_IMAGE=

# >=pacific
GRAFANA_DASHBOARDS_DIR=monitoring/ceph-mixin/dashboards_out
PROMETHEUS_ALERTS_DIR=monitoring/ceph-mixin
# <pacific
#GRAFANA_DASHBOARDS_DIR=monitoring/grafana/dashboards
#PROMETHEUS_ALERTS_DIR=monitoring/prometheus/alerts

PROMETHEUS_HOST_PORT=9090
#PROMETHEUS_IMAGE=
THANOS_IMAGE=thanosio/thanos:main-2023-10-16-77fac93
NODE_EXPORTER_HOST_PORT=9100
#NODE_EXPORTER_IMAGE=
ALERTMANAGER_HOST_PORT=9093
#ALERTMANAGER_IMAGE=
KEYCLOAK_HOST_HTTP_PORT=8080
KEYCLOAK_HOST_HTTPS_PORT=8443
#KEYCLOAK_IMAGE=
HAPROXY_HOST_HTTP_PORT=80
HAPROXY_HOST_HTTPS_PORT=443
#HAPROXY_IMAGE=

CEPH2_IMAGE=rhcsdashboard/ceph-rpm:main
CEPH2_REPO_DIR=/home/ankushbehl/work/ceph/ceph2/ceph
CEPH2_PROXY_HOST_PORT=4202
CEPH2_HOST_PORT=11002
CEPH2_CUSTOM_BUILD_DIR=
CEPH2_E2E_IMAGE=rhcsdashboard/ceph-e2e:nautilus

# Development options
CEPH_DEBUG=0
DASHBOARD_DEV_SERVER=1
DASHBOARD_SSL=1
DASHBOARD_URL=
RGW_MULTISITE=1

# set this to a downstream product
# note: multiple builds are not supported
#DOWNSTREAM_BUILD=ibm

# Sanity checks' options
#APPLITOOLS_API_KEY=
CHECK_MYPY=1

# vstart.sh env. vars.
FS=0
MDS=3
MGR=1
MON=3
#MON_MAX_PG_PER_OSD=2000
NFS=0
OSD=3
RGW=2
31 changes: 31 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,37 @@ services:
- ./docker/prometheus:/etc/prometheus:Z
- ${CEPH_REPO_DIR}/${PROMETHEUS_ALERTS_DIR:-monitoring/ceph-mixin}:/etc/prometheus/alerts:Z

thanos-sidecar:
image: ${THANOS_IMAGE}
container_name: thanos-sidecar
hostname: thanos-sidecar
volumes_from:
- prometheus:rw
command:
- "sidecar"
- "--tsdb.path=/prometheus"
- "--prometheus.url=http://prometheus:9090"
expose:
- 10901
- 10902
depends_on:
- prometheus

thanos-querier:
image: ${THANOS_IMAGE}
container_name: thanos-querier
hostname: thanos-querier
command:
- "query"
- "--store=thanos-sidecar:10901"
expose:
- 10902
- 10901
ports:
- "10902:10902"
depends_on:
- thanos-sidecar

node-exporter:
image: ${NODE_EXPORTER_IMAGE:-prom/node-exporter:v1.5.0}
container_name: node-exporter
Expand Down
7 changes: 7 additions & 0 deletions docker/grafana/provisioning/datasources/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ datasources:
orgId: 1
url: http://prometheus:9090
editable: true

- name: Thanos
type: prometheus
access: proxy
orgId: 1
url: http://thanos-querier:10902
editable: true
6 changes: 4 additions & 2 deletions docker/prometheus/ceph-targets.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
[
{
"targets": [ "ceph:9283" ],
"labels": {}
"labels": {
cluster: "cluster1"
}
},
{
"targets": [ "ceph2:9283" ],
"labels": {}
}
]
]
2 changes: 1 addition & 1 deletion docker/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
global:
scrape_interval: 5s
evaluation_interval: 5s

cluster: cluster1
scrape_configs:
- job_name: 'node-exporter'
file_sd_configs:
Expand Down

0 comments on commit b4bbc49

Please sign in to comment.