Skip to main content

Configure Logging and Monitoring in EKS/Kind/Minikube with External Prometheus and Loki Service

Logs Collection via Promtail and Push to External Loki

Step 1: Add the Grafana Helm repository

Step 2: Edit Custom Endpoint Push

Open the promtail-values.yaml file and configure the Loki API endpoint.
Update the Loki URL under the clients section:

Step 3: Apply Changes

Install Promtail using the modified promtail-values.yaml file:
Check the status of Promtail pods:
View Promtail logs:
Check the status of Promtail pods again:

Metrics Collection and Sending to k*s_prometheus-server and Then External Prometheus Server

Step 1: Install Prometheus

Update the Helm repositories and install Prometheus in the monitoring namespace:

Step 2: Export Prometheus Values

Export the Prometheus default values to customize them:

Step 3: Edit Remote Write Endpoint for Custom Push

Open the prom-values.yaml file and edit the remote write endpoint for the external Prometheus server.
Modify the remote_write section:
Modify the Persistent storage section:
Modify the Persistent storage section:
If Required kubectl delete statefulset prometheus-alertmanager -n monitoring
Note: Ensure that the external Prometheus has the flag --web.enable-remote-write-receiver enabled to accept connections from the EKS Prometheus.

Step 4: Apply Changes

Install or upgrade Prometheus with the modified configuration:
Check the status of Prometheus pods:

Imp : Grafana Dash ID’s for Kubernetes : 15760 / 15757

Step 5: if prometheus pod is in error state due to PV and PVC

Create a PV and PVC with storage class in any one of the nodes which use the local storage to storage the data or you can use the AWS ebs if needed in you enviroment. Provide the Node Name
This setup allows you to collect logs via Promtail and metrics via Prometheus in your EKS cluster, pushing them to external Loki and Prometheus services for centralized monitoring.