Skip to content

This project contains everything from creating a Kubernetes cluster from scratch to monitoring applications using Prometheus,Grafana and Alertmanager.

Notifications You must be signed in to change notification settings

amanpreet9391/Monitoring-kubernetes-with-Prometheus

Repository files navigation

Application Monitoring with Prometheus

Screenshot 2021-04-01 at 3 49 12 AM

Setting up Kubernetes Cluster

net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF

  • sysctl --system
  • Copy paste this token to worker nodes -> kubeadm join tokengenerated at master node
  • systemctl restart kubelet

Screenshot 2021-03-30 at 4 59 42 PM

Setting up Prometheus

use script install_prometheus.sh Screenshot 2021-03-31 at 3 06 48 AM

Install node exporter in worker nodes

use script install_node_exporter.sh

Install grafana

use script install_grafana.sh Create data source -> Prometheus Screenshot 2021-03-31 at 3 29 31 AM

Recording rules

Recording rules allows us to precompute frequently needed or computationally expensive expressions and save their result as a new set of time series.
create a prometheus_rules.yml containing the necessary rule statements and then have Prometheus load the file via the rule_files field in the prometheus configuration i.e., prometheus.yml.
Screenshot 2021-03-31 at 4 16 20 AM

Alertmanager

The AlertManager uses a configuration file named alertmanager.yml
we create the AlertManager systemd service
Then reload the daemon and start the alertmanager service

This is how the Alerts will be visible on Prometheus Dashboard.
Screenshot 2021-03-31 at 4 56 20 AM
This is how alert will come on alertmanager dashboard
Screenshot 2021-03-31 at 4 56 35 AM
We can configure the notification part i.e. where we want to get alert notification, Slack, Email, Pagerduty etc. In this case, alert notification will come on Slack alerts channel.
Screenshot 2021-03-31 at 4 56 04 AM
After the problem causing alert is being resolved.
Screenshot 2021-03-31 at 5 03 46 AM

About

This project contains everything from creating a Kubernetes cluster from scratch to monitoring applications using Prometheus,Grafana and Alertmanager.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages