Monitoring in Kubernetes(Hands-On)

Setting up the infrastructure:


helm install stable/prometheus-blackbox-exporter — name prometheus-blackbox — namespace monitoring -f blackbox_exporter.yaml
helm install stable/prometheus --name my-first-cluster-prometheus --namespace monitoring -f prometheus.yaml# Extra scrape job
extraScrapeConfigs: |
- job_name: 'prometheus-blackbox-exporter'
metrics_path: /probe
params:
module: [http_2xx]
static_configs:
- targets:
- http://details.bookinfo.svc.cluster.local
- http://reviews.bookinfo.svc.cluster.local
replacement: prometheus-blackbox-prometheus-blackbox-exporter:9115
helm install stable/grafana --name grafana --namespace monitoring -f grafana.yaml
datasources:  
datasources.yaml:
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
url: http://my-first-cluster-prometheus-server.monitoring.svc.cluster.local
access: proxy
isDefault: true
  1. Goto Home -> Manage -> Import (and add the dashboard id to import).
  2. Select data source as Prometheus in form and click import.

Alerting

grafana.ini:
smtp:
enabled: true
host: smtp.sendgrid.net:465
user: apikey
password: <Your Sendgrid API-KEY Here>
---
helm upgrade grafana stable/grafana --namespace monitoring -f grafana.yaml
kubectl scale deployment details-v1 --replicas=0 -n bookinfo

Summary:

--

--

--

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

Reading Math & Its History (02)

From Zero to Snowpark in 5 minutes

Universities Must Do More About Campus Sexual Assault #MeToo

Python ternary operator

A Performance Analysis That is Out of the Box

Mutation and contract testing

Programming for Cats — Part #2

How to build an automated end-to-end Infrastructure(using EFS)on AWS using Terraform?

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

Install Gitlab runner on ubuntu work with dind

Docker A to Z

Easy way to capture tcpdump in kubernetes

Docker Networks