Complete Monitoring & Logging for AWS Graviton EKS: Prometheus, Grafana & More!

Complete Monitoring & Logging for AWS Graviton EKS

Here’s a Terraform + Kubernetes setup to add monitoring and logging to your Graviton-based AWS EKS cluster using Prometheus & Grafana πŸš€


πŸ”Ή Step 1: Install helm and kubectl

# Install Helm
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash

# Verify Helm installation
helm version

# Ensure `kubectl` is configured
aws eks --region us-east-1 update-kubeconfig --name graviton-eks-cluster
kubectl get nodes

πŸ”Ή Step 2: Deploy Prometheus & Grafana using Helm

helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update

# Install Prometheus stack
helm install prometheus-stack prometheus-community/kube-prometheus-stack --namespace monitoring --create-namespace

# Check status
kubectl get pods -n monitoring

πŸ”Ή Step 3: Expose Grafana for External Access

Create a LoadBalancer service for Grafana (grafana-service.yaml):

apiVersion: v1
kind: Service
metadata:
  name: grafana
  namespace: monitoring
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-type: "alb"
spec:
  selector:
    app.kubernetes.io/name: grafana
  ports:
    - protocol: TCP
      port: 80
      targetPort: 3000
  type: LoadBalancer

Apply the service:

kubectl apply -f grafana-service.yaml

Check the external URL:

kubectl get svc -n monitoring

Look for EXTERNAL-IP under the grafana service.


πŸ”Ή Step 4: Get Grafana Admin Password

kubectl get secret -n monitoring prometheus-stack-grafana -o jsonpath="{.data.admin-password}" | base64 --decode

Login to Grafana using:

  • URL: http://<EXTERNAL-IP>
  • Username: admin
  • Password: <output from command above>

πŸ”Ή Step 5: Configure Prometheus as a Data Source in Grafana

  1. Go to Grafana β†’ Settings β†’ Data Sources
  2. Add a new data source β†’ Select Prometheus
  3. Enter URL: http://prometheus-stack-kube-p-prometheus.monitoring.svc:9090
  4. Save & Test

πŸ”Ή Step 6: Import Kubernetes Dashboards

  • Go to Grafana β†’ Dashboards β†’ Import
  • Enter Dashboard ID: 3119 (Kubernetes Cluster Monitoring)
  • Click Load and select Prometheus as the data source

πŸŽ‰ Now you have a fully monitored Graviton-based Kubernetes cluster! πŸŽ‰

Would you like to enable centralized logging with Loki & Fluentd? πŸš€

About Anant 443 Articles
Senior technical writer

1 Trackbacks & Pingbacks

  1. Terraform setup for a production-ready, auto-scaling, and load-balanced AWS EKS cluster – KTCHost

Comments are closed.