Skip to content
EgyKode
Guided lab

Deploying Kube-Prometheus-Stack on AWS EKS

31 minAdvanced

This creates billable resources. Run it in a dev environment and destroy it when you finish. Set a budget alarm first.

Success criteria

0 of 3

What you are building#

What is Kube-Prometheus-Stack?#

Kube-Prometheus-Stack is a comprehensive, production-ready Kubernetes observability suite. It packages:

  • Prometheus Operator: Manages Prometheus and Alertmanager instances using custom Kubernetes CRDs (ServiceMonitor, PrometheusRule).
  • Prometheus: High-performance time-series database scraping metrics from nodes, pods, and services via Kubernetes API discovery.
  • Alertmanager: Deduplicates, groups, and routes alert notifications.
  • Grafana: Real-time metrics visualization platform.
  • kube-state-metrics & node-exporter: Generates host-level and cluster object metrics.
text
                                OBSERVALITY & MONITORING STACK
                                
  +-----------------------------------------------------------------------------------+
  |  AWS EKS WORKER NODES & PODS                                                      |
  |  [ Pod 1 Metrics ]        [ Pod 2 Metrics ]        [ Kubelet Node Exporter ]      |
  +-----------------------------------+-----------------------------------------------+
                                      |
                                      | Scrapes Metrics via ServiceMonitor (30s)
                                      v
  +-----------------------------------------------------------------------------------+
  |  PROMETHEUS TIME-SERIES DATABASE (prometheus-0)                                   |
  |  Stores CPU, Memory, Network, Disk & Custom App Metrics                           |
  +-----------------------------------+-----------------------------------------------+
                                      |
                                      | PromQL Queries
                                      v
  +-----------------------------------------------------------------------------------+
  |  GRAFANA DASHBOARDS (Port 3000)                                                   |
  |  Real-time RED Metrics & Infrastructure Dashboards                                |
  +-----------------------------------------------------------------------------------+

Steps#

Step 1: Execute Automated Monitoring Deployment Script#

Terminal
cd 07-Monitoring-Observability/Lab17-Prometheus-Grafana-Monitoring-Stack
chmod +x install/install.sh
./install/install.sh

Step 2: Access Grafana Web UI#

Terminal
kubectl port-forward svc/prometheus-grafana 3000:80 -n monitoring

Open web browser to http://localhost:3000 (Default Credentials: admin / prom-operator).


Verify it worked#

Terminal
kubectl get pods -n monitoring

Expected Output:

text
NAME                                                        READY   STATUS    RESTARTS   AGE
prometheus-kube-prometheus-prometheus-0                     2/2     Running   0          2m
prometheus-grafana-7d8b9f7c4d-x9y8z                        1/1     Running   0          2m
prometheus-kube-state-metrics-6d8b9f7c4d-v1w2u             1/1     Running   0          2m


Clean up#

Run this even if you did not finish. Everything above is destroyable, and an account full of half-built experiments is how a surprise bill starts.

DestructiveThis removes real resources. Check which environment you are in first.

Terminal
helm uninstall kube-prometheus-stack -n monitoring
kubectl delete pvc --all -n monitoring   # PVCs are NOT removed by uninstall
aws ec2 describe-volumes --filters Name=status,Values=available --query 'Volumes[].[VolumeId,Size]' --output table

Cost of this lab: Depends on an existing cluster. kube-prometheus-stack requests persistent volumes — EBS at ~$0.08/GB-month — which survive helm uninstall because the PVCs are retained deliberately.

The concept behind it

Ready to try it without help?Do the challenge