Monitoring in Kubernetes (Multi-Cluster environment)

Establishing our environment:

Central Monitoring (Federation):

Setting Up Central 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
# Create monitoring namespace
kubectl create ns monitoring
# Install grafana
helm install stable/grafana --name grafana --namespace monitoring -f grafana.yaml
## Import the kubernetes cost and microservice health dashboards as described in hands-on
# Install Prometheus
helm install stable/prometheus --name my-first-cluster-prometheus --namespace monitoring -f prometheus-central.yaml

Configuring Grafana

  1. Goto dashboard Settings -> Variables. Click New.

--

--

--

Bikes, Tea, Sunset, IndieMusic in that order. Software Engineer who fell in love with cloud-native infrastructure.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

5 factors why agile working makes sense

PWF WooCommerce Product Filters v1.6.2

Creating a simple “Brand Name Generator” using Python

RESTful, Resource-Oriented Architecture

TryHackMe : Lian_yu walkthrough

How to Reset Zigo Eon 42i

reset my phone

Java Generics and collections

What’s new in Kubernetes 1.17?

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
ADIL RAFIQ

ADIL RAFIQ

Bikes, Tea, Sunset, IndieMusic in that order. Software Engineer who fell in love with cloud-native infrastructure.

More from Medium

How to Deploy Logstash to a Kubernetes cluster

Securing Kubernetes Secrets with HashiCorp Vault

Upgrading Terraform Helm charts to Helm 3 with K8s v1.22

Prometheus installation in Google Kubernetes Engine