Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Monitoring Example Multi-Cluster Enviornment
# See https://github.com/helm/charts/tree/master/stable/prometheus
extraScrapeConfigs: |
# Prometheus Federation. Scrape metrics from prometheus cross-cluster
- job_name: 'my-first-cluster'
scrape_timeout: 30s
honor_labels: true
metrics_path: '/federate'
params:
'match[]':
- '{job="prometheus"}'
- '{job="prometheus-pushgateway"}'
- '{job="prometheus-blackbox-exporter"}'
- '{job="kubernetes-apiservers"}'
- '{job="kubernetes-nodes"}'
- '{job="kubernetes-nodes-cadvisor"}'
- '{job="kubernetes-pods"}'
- '{job="kubernetes-service-endpoints"}'
- '{job="kubernetes-nodes-cadvisor"}'
- '{job="kubernetes-pods"}'
- '{__name__=~"job:.*"}'
static_configs:
- targets:
- '<Link to prometheus in my-first-cluster>'
labels:
cluster: my-first-cluster
- job_name: 'my-second-cluster'
scrape_timeout: 30s
honor_labels: true
metrics_path: '/federate'
params:
'match[]':
- '{job="prometheus"}'
- '{job="prometheus-pushgateway"}'
- '{job="ambassador"}'
- '{job="prometheus-blackbox-exporter"}'
- '{job="kubernetes-apiservers"}'
- '{job="kubernetes-nodes"}'
- '{job="kubernetes-nodes-cadvisor"}'
- '{job="kubernetes-pods"}'
- '{job="kubernetes-service-endpoints"}'
- '{job="kubernetes-nodes-cadvisor"}'
- '{job="kubernetes-pods"}'
- '{__name__=~"job:.*"}'
static_configs:
- targets:
- '<Link to prometheus in my-second-cluster>'
labels:
cluster: my-second-cluster
# Alerting handled by Grafana
alertmanager:
enabled: false
## Monitors ConfigMap changes and POSTs to a URL
## Ref: https://github.com/jimmidyson/configmap-reload
##
configmapReload:
name: configmap-reload
image:
repository: jimmidyson/configmap-reload
tag: v0.2.2
pullPolicy: IfNotPresent
server:
enabled: true
name: server
image:
repository: prom/prometheus
tag: v2.13.1
pullPolicy: IfNotPresent
## Path to a configuration file on prometheus server container FS
configPath: /etc/config/prometheus.yml
global:
## How frequently to scrape targets by default
##
scrape_interval: 1m
## How long until a scrape request times out
##
scrape_timeout: 10s
## How frequently to evaluate rules
##
evaluation_interval: 1m
##
## Data Storage in persistent volume.
# persistentVolume:
# enabled: true
# mountPath: /data
# subPath: ""
# storageClass: "ssd"
# accessModes:
# - ReadWriteOnce
# size: 250Gi
nodeExporter:
enabled: false
pushgateway:
## If false, pushgateway will not be installed
enabled: false
kubeStateMetrics:
enabled: false
networkPolicy:
enabled: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment