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
- Clone the k3s-monitoring repository:
git clone https://github.com/cablespaghetti/k3s-monitoring.git
cd k3s-monitoring
- Add the Prometheus Helm chart repository:
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
- Install Prometheus and Grafana:
helm upgrade --install prometheus prometheus-community/kube-prometheus-stack --version 39.13.3 --values kube-prometheus-stack-values.yaml
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
- Edit the service for Grafana to use a NodePort:. Then change the type to NodePort and save.
kubectl edit service/prometheus-grafana
- Access Grafana:. Use the following credentials to login:
http://<your-k3s-node-ip>:<nodeport>/login
- user: admin
- pass: prom-operator
- 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
You’ll be able to see now all the resource of the node and their usage:
node exporter full
No comments:
Post a Comment