Tuesday, 15 August 2023

Install Prometheus and Grafana on K3s (Using Helm)

 

Install Prometheus and Grafana on K3s

Prometheus is an open-source monitoring and alerting tool that collects and stores time-series data, while Grafana is a popular data visualization platform that allows you to create interactive dashboards and visualizations.

By combining these tools, you can gain valuable insights into your Kubernetes cluster’s performance and health, making it easier to identify and troubleshoot issues. However, setting up this stack can be a daunting task, especially if you’re not familiar with the process.

That’s why I’m excited to provide you with a comprehensive tutorial that will guide you through the entire process step-by-step, from installing k3s to configuring Prometheus and Grafana. With my tutorial, you’ll be able to install and configure this powerful monitoring stack in just 5 minutes, saving you a lot of time and effort

  1. Clone the k3s-monitoring repository:

    git clone https://github.com/cablespaghetti/k3s-monitoring.git 

  2. cd k3s-monitoring

  3. Add the Prometheus Helm chart repository:

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

  4. Install Prometheus and Grafana:

    helm upgrade --install prometheus prometheus-community/kube-prometheus-stack --version 39.13.3 --values kube-prometheus-stack-values.yaml

  5. export KUBECONFIG=/etc/rancher/k3s/k3s.yaml

  6. Edit the service for Grafana to use a NodePort:

    kubectl edit service/prometheus-grafana

    . Then change the type to NodePort and save.
  7. Access Grafana:

    http://<your-k3s-node-ip>:<nodeport>/login

    . Use the following credentials to login:

    • user: admin
    • pass: prom-operator
  8. Import the desired dashboards.
    • just type 1860 on the search to find the node exporter dashboard. This gives the complete vision on the node resources.
dashboard install grafana.com

dashboard install grafana.com

You’ll be able to see now all the resource of the node and their usage:

node exporter full

node exporter full


No comments:

Post a Comment

How to upgrade Maven

  java.lang.IllegalStateException I had installed maven in my ubuntu using command  apt install maven This installed maven in path /usr/shar...