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

Getting, VirtualBox “drag and drop” feature and using “alt + Tab” keys to swith between Host…

Tell, don’t ask —  learn to talk to your objects

CLI with API

Top 3 Alternative Python Packages for Pandas

How to upload your first library to Open Source

LeetCode Palindrome Number

Git: remove branches except main

Fantastic Bugs and Where to Find Them

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

Kubernetes Blue-Green Deployment

Automation Workflows: GitOps for YugabyteDB with Argo CD and Helm

Running Spacelift CI/CD workers in Kubernetes using DinD

Comprehensive Guide on Integrating Open Policy Agent (OPA) With Kubernetes