Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
Unix & Linux ServerSpeech Synthesis on Linux: Adding a Voice to Scripts and Systems(01.10.2026 um 18:00 Uhr)
•
Unix & Linux ServerYT-DLP is Being Treated as a Piracy Tool By The IFPI(01.10.2026 um 17:25 Uhr)
••
Unix & Linux ServerDutch Government Turns to Open Source for Digital Sovereignty(01.10.2026 um 18:33 Uhr)
•
Linux Tipps & HardeningDistribution Release: Nitrux 7.0.0(01.10.2026 um 20:35 Uhr)
•
Unix & Linux ServerDevelopment Release: Ubuntu 26.10 Beta(02.10.2026 um 00:37 Uhr)
•
Linux Tipps & HardeningDistribution Release: umbrelOS 2.0.0(02.10.2026 um 02:24 Uhr)
•
Unix & Linux ServerSecurity: Zwei Probleme in OpenSSL (Ubuntu)(01.10.2026 um 23:37 Uhr)
•
Unix & Linux ServerSecurity: Ausführen beliebiger Kommandos in KCoreAddons (Ubuntu)(01.10.2026 um 23:37 Uhr)
•
Unix & Linux ServerSecurity: Denial of Service in rpcbind (SUSE)(01.10.2026 um 23:37 Uhr)
•
Unix & Linux ServerSpeech Synthesis on Linux: Adding a Voice to Scripts and Systems(01.10.2026 um 18:00 Uhr)
•
Unix & Linux ServerYT-DLP is Being Treated as a Piracy Tool By The IFPI(01.10.2026 um 17:25 Uhr)
••
Unix & Linux ServerDutch Government Turns to Open Source for Digital Sovereignty(01.10.2026 um 18:33 Uhr)
•
Linux Tipps & HardeningDistribution Release: Nitrux 7.0.0(01.10.2026 um 20:35 Uhr)
•
Unix & Linux ServerDevelopment Release: Ubuntu 26.10 Beta(02.10.2026 um 00:37 Uhr)
•
Linux Tipps & HardeningDistribution Release: umbrelOS 2.0.0(02.10.2026 um 02:24 Uhr)
•
Unix & Linux ServerSecurity: Zwei Probleme in OpenSSL (Ubuntu)(01.10.2026 um 23:37 Uhr)
•
Unix & Linux ServerSecurity: Ausführen beliebiger Kommandos in KCoreAddons (Ubuntu)(01.10.2026 um 23:37 Uhr)
•
Unix & Linux ServerSecurity: Denial of Service in rpcbind (SUSE)(01.10.2026 um 23:37 Uhr)
•
Intelligence View
⚡ tsecurity.de Intelligence

Monitoring Your Kubernetes Cluster: A Beginner’s Guide to Setting Up Prometheus and Grafana

Learn how to install, configure, and visualize Kubernetes metrics with Prometheus and Grafana for effective monitoring. 💡 Introduction Welcome to the world of D…

Beitrag
0
Seite
0
↗ Quelle (dev.to)
Social ReaktionenReagiere als Erste:r — dein Feedback zählt!

Learn how to install, configure, and visualize Kubernetes metrics with Prometheus and Grafana for effective monitoring.







💡 Introduction



Welcome to the world of DevOps! Today, we’ll walk through setting up Prometheus and Grafana on a Kind Kubernetes cluster using Helm. But before we dive into the technical steps, let’s understand what these tools are and why they matter.



We’ll be using AWS to create an EC2 instance, which will act as our main machine for setting up the cluster. If you’re new to AWS, Kubernetes, Prometheus, or Grafana, don’t worry—I’ll break it down for you.






What Are These Tools?




  • AWS (Amazon Web Services): A cloud platform that provides services like computing, storage, and networking.


  • Kind (Kubernetes IN Docker): A tool that lets you run a lightweight Kubernetes cluster on your local machine using Docker. It’s similar to Minikube but uses container nodes instead of virtual machines.


  • Prometheus: A powerful monitoring tool that scrapes metrics from Kubernetes nodes, pods, and applications. You can also instrument your applications using Prometheus client libraries.


  • Grafana: A visualization tool that takes data from Prometheus (or other sources like Loki) and displays it in interactive dashboards.







Project Workflow



Here’s a step-by-step breakdown of what we’ll be doing:



✅ Create an EC2 instance (t2.medium)

✅ Install Docker and Kind on the instance

✅ Create a Kubernetes cluster using Kind

✅ Install and configure kubectl (Kubernetes command-line tool)

✅ Apply Kubernetes manifests for deployment

✅ Install Helm (a package manager for Kubernetes)

✅ Deploy the kube-prometheus-stack using Helm

✅ Access Prometheus on port 9090

✅ Access Grafana on port 3000







💡 Pre-requisites



Before we dive into setting up Prometheus and Grafana, let’s make sure you have the necessary requirements in place.





✨ What You’ll Need:





  • An AWS Account: Since we’ll be creating an EC2 instance to act as our main machine, you need access to AWS. If you don’t have an account yet, you can sign up at aws.amazon.com.


  • Basic Understanding of Kubernetes and Docker: While I’ll walk you through each step, having some familiarity with Kubernetes (k8s) and Docker will make things easier. If you’re new to these technologies, here’s a quick breakdown:


  • Docker: A tool for containerizing applications, allowing them to run consistently across different environments.


  • Kubernetes: An orchestration system that manages containerized applications across multiple nodes.



Once you have these prerequisites ready, we’re all set to move forward with the setup! 🚀







Step 1: Creating an AWS EC2 Instance




  1. Log in to your AWS account and navigate to the EC2 Dashboard.

  2. Click Launch Instance and configure the instance as follows:



    • Name: Prom-Graf-Project


    • OS: Ubuntu (latest version)


    • Instance Type: t2.medium


    • Key-Pair: Select an existing key or create a new one


    • Storage: Allocate at least 15GB



  3. Click Launch Instance.



Image description





Connect to the Instance



Once the instance is running, SSH into it using:




ssh -i /path/to/key-pair.pem ubuntu@<EC2-PUBLIC-IP>









Install Docker






sudo apt update
sudo apt install docker.io -y
sudo usermod -aG docker $USER && newgrp docker












Step 2: Installing Kind and Kubectl



Clone the GitHub repo containing required scripts:




git clone https://github.com/Pravesh-Sudha/k8s-kind-voting-app.git
cd k8s-kind-voting-app/kind-cluster









Install Kind






chmod +x install_kind.sh
./install_kind.sh









Install Kubectl






chmod +x install_kubectl.sh
./install_kubectl.sh
kind create cluster --config=config.yml






Image description



Image description






Deploy Kubernetes Manifests






cd ../k8s-specifications
kubectl apply -f .






Image description









Step 3: Installing Helm, Prometheus, and Grafana






Install Helm






curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh









Install Kube-Prometheus-Stack






helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo add stable https://charts.helm.sh/stable
helm repo update
kubectl create namespace monitoring

helm install kind-prometheus prometheus-community/kube-prometheus-stack --namespace monitoring \
--set prometheus.service.nodePort=30000 \
--set prometheus.service.type=NodePort \
--set grafana.service.nodePort=31000 \
--set grafana.service.type=NodePort






Image description



Image description






Verify Deployment






kubectl get svc -n monitoring
kubectl get namespace









Expose Prometheus and Grafana Services






kubectl port-forward svc/kind-prometheus-kube-prome-prometheus -n monitoring 9090:9090 --address=0.0.0.0 &
kubectl port-forward svc/kind-prometheus-grafana -n monitoring 3000:80 --address=0.0.0.0 &








  • Prometheus Dashboard: http://<EC2-IP>:9090



Image description





  • Grafana Dashboard: http://<EC2-IP>:3000



Image description









Step 4: Running Prometheus Queries



Open Prometheus Dashboard (http://<EC2-IP>:9090) and run the following queries:



CPU Usage (%)




sum (rate (container_cpu_usage_seconds_total{namespace="default"}[1m])) / sum (machine_cpu_cores) * 100






Memory Usage by Pod




sum (container_memory_usage_bytes{namespace="default"}) by (pod)






Network Data Received by Pod




sum(rate(container_network_receive_bytes_total{namespace="default"}[5m])) by (pod)






Network Data Transmitted by Pod




sum(rate(container_network_transmit_bytes_total{namespace="default"}[5m])) by (pod)









Generate Traffic



Expose the voting application:




kubectl port-forward service/vote 5000:5000 --address=0.0.0.0 &






Image description



Visit http://<EC2-IP>:5000, interact with the app (cast votes, refresh), then re-run queries in Prometheus.



Image description



Image description









Step 5: Visualizing Metrics in Grafana




  1. Open Grafana at http://<EC2-IP>:31000


  2. Login Credentials:



    • Username: admin


    • Password: prom-operator



  3. Navigate to Dashboard → New → Import Dashboard

  4. Enter Dashboard ID: 15661

  5. Set the data source as Prometheus and click Import.



Image description



Your metrics are now visualized in Grafana! 🎉



Image description









Conclusion



With this setup, you now have a fully functional monitoring system for your Kubernetes cluster using Prometheus and Grafana. You can further:



✅ Add custom Grafana dashboards

✅ Enable Alertmanager for alerts

✅ Integrate Loki for log monitoring



By continuously monitoring your cluster, you ensure better performance, reliability, and efficiency. Happy monitoring! 🚀

🔍 CTI & Forensik

Cyber Threat Intelligence & Forensik

ATT&CK-Navigator · IoC-Radar · Exploit-Belege
CTI Threat Relationship Graph
Akteure · Techniken · Beziehungen
2 Knoten · 1 Relationen
CVE / Incident Threat Actor Software MITRE ATT&CK CWE Weakness IoC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Monitoring Your Kubernetes Cluster: A Beginner’s Guide to Setting Up Prometheus and Grafana

Thematisch verwandte Begriffe: Monitoring, Your, Kubernetes, Cluster · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag