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

Extracting the Metadata from an IBM FileNet Document’s Content

If you have been following the latest trends in IT, DevOps and software development, you have…

Docker Brings Scale at Cost

Speeding up your CI Pipeline by introducing Incremental Analysis on SonarQube

Dive into Refactoring

Graph Pattern for Beginners Part-2 with BFS Template

Using an Everyday Marketing Tool for Scrum: Trello

ONE COMMAND set-up for Scala development

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

What do we use Gitlab schedule pipelines for?

[K8s] How to restart Kubernetes Pods

How to build Kubernetes Operators in Go

Securing credentials in Fluentd configurations