MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

How to deploy Prometheus & Grafana in Kubernetes?

Prometheus Stack

The Prometheus stack typically includes several components that work together to provide comprehensive monitoring and alerting capabilities for your infrastructure and applications. Here’s a table outlining the core components of the Prometheus stack:

ComponentDescription
PrometheusTime-series database and monitoring tool that collects and stores metrics from various sources. It serves as the core of the stack.
AlertmanagerHandles alerts generated by Prometheus and manages their routing, deduplication, and notification to various alerting channels (e.g., email, Slack).
Node ExporterA Prometheus exporter for collecting hardware and OS-level metrics from individual nodes in your cluster (e.g., CPU, memory, disk usage).
Exporters (e.g., Prometheus Blackbox Exporter, SNMP Exporter)Exporters are small applications that expose metrics in a format Prometheus can scrape. They are used to collect specialized metrics from various services and systems.
GrafanaA popular open-source dashboard and visualization platform that integrates with Prometheus to create and display custom dashboards and graphs.
PushgatewayAllows for the collection of metrics from batch jobs or other short-lived processes that cannot be scraped directly by Prometheus. It acts as an intermediary between these jobs and Prometheus.
Prometheus OperatorAn operator that simplifies the management and operation of Prometheus, Alertmanager, and related resources in Kubernetes clusters.
Thanos (Optional)An extension to Prometheus that provides long-term storage, global query view, and horizontal scalability for Prometheus. It’s often used for large-scale or federated deployments.

Methods of Prometheus Deployment in Kubernetes

1. Prometheus Operator

The Prometheus Operator uses Kubernetes custom resources to simplify the deployment and configuration of Prometheus, Alertmanager, and related monitoring components.
URL – https://github.com/prometheus-operator/prometheus-operator

2. kube-prometheus

kube-prometheus provides example configurations for a complete cluster monitoring stack based on Prometheus and the Prometheus Operator. This includes deployment of multiple Prometheus and Alertmanager instances, metrics exporters such as the node_exporter for gathering node metrics, scrape target configuration linking Prometheus to various metrics endpoints, and example alerting rules for notification of potential issues in the cluster.
URL – https://github.com/prometheus-operator/kube-prometheus

3. helm chart

The prometheus-community/kube-prometheus-stack helm chart provides a similar feature set to kube-prometheus. This chart is maintained by the Prometheus community. For more information, please see the chart’s readme
URL – https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack

4. kube-prometheus

If you want the whole stack, you must try kube-prometheus. This Components included in this package:

  • The Prometheus Operator
  • Highly available Prometheus
  • Highly available Alertmanager
  • Prometheus node-exporter
  • Prometheus Adapter for Kubernetes Metrics APIs
  • kube-state-metrics
  • Grafana

URL – https://github.com/prometheus-operator/kube-prometheus


$ git clone https://github.com/prometheus-operator/kube-prometheus
$ cd kube-prometheus
$ ls manifests/setup/
$ kubectl apply --server-side -f manifests/setup
$ kubectl wait --for condition=Established --all CustomResourceDefinition --namespace=monitoring
$ kubectl apply -f manifests/
$ kubectl get ns
$ kubectl get all -n monitoring
$ kubectl patch svc grafana --type='json' -p '[{"op":"replace","path":"/spec/type","value":"NodePort"}]' -nmonitoring
$ kubectl get all -n monitoring
$ kubectl --namespace monitoring port-forward  --address 0.0.0.0 svc/grafana 3000

http://34.207.57.210:3000/
admin
admin

Prometheus STACK Deployment Using Kube Prometheus

Kube-prometheus compatibility table mapping releases 0.10 to main against Kubernetes 1.22 to 1.28

Prometheus & Grafana Deployment Using Helm Chart

Configure Data Sources and Dashboards in Grafana

  1. Log in to Grafana using the default credentials (admin/admin).
  2. Add Prometheus as a data source:
  3. Import or create dashboards in Grafana to visualize your Kubernetes cluster’s metrics. You can find pre-built dashboards for Kubernetes and Prometheus in the Grafana dashboard marketplace.

Reference

  • https://prometheus-operator.dev/
  • https://grafana.com/docs/grafana-cloud/monitor-infrastructure/kubernetes-monitoring/configuration/configure-infrastructure-manually/prometheus/prometheus-operator/

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services โ€” all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

Master Monitoring with Prometheus & Grafana Training in Chennai

Introduction In today’s fast-moving world of software and IT, keeping a close watch on your systems is not just helpfulโ€”it is essential. Think about it: when a…

Read More

What is Prometheus and use cases of Prometheus?

What is Prometheus? Prometheus is an open-source monitoring and alerting toolkit designed for reliability and scalability. It is particularly well-suited for monitoring dynamic, cloud-native environments. Prometheus focuses…

Read More

Install & Configure Prometheus in Kubernetes Cluster

Step 1- Create 2 PV for Prometheus server & Alert Manager Step 2 – Install using Helm Step 3 – How to access? Rajesh Kumar I’m Rajesh…

Read More

Topics to learn in Prometheus with Grafana Training

1. Introduction – Prometheus Introduction to Prometheus Prometheus installation Grafana with Prometheus Installation 2. Monitoring Introduction to Monitoring Client Libraries Pushing Metrics Querying Service Discovery Exporters 3….

Read More

Interview Questions & Answer for Prometheus

What is Prometheus? What are some of Prometheus’s main features? Describe Prometheus architecture and components Can you compare Prometheus to other solutions like InfluxDB for example? What…

Read More

What is Prometheus and How it works?

Meaning of Prometheus In Greek mythology, Prometheus, possibly meaning “forethought”), is a Titan god of fire. Prometheus is known for his intelligence and for being a champion…

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x