-
-
Save jayunit100/86d401f6c5dc3aa36e00a43b7ffe1ea2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Skip to content | |
| SHOW | |
| August 21, 2017 | |
| Setting up node_exporter for helm based kubernetes installs. | |
| Prometheus is an open source library for collecting metrics from cloud native | |
| systems (or any systems, really). | |
| Especially in distributed system, it could get difficult to measure | |
| things in one, but thanks to Prometheus, we could grab metrics from each node | |
| and gain some insights on scalability and etc. | |
| Node exporter is used to export the system level metrics on each node of our | |
| kubernetes cluster. However, the helm recipes for kube dont start exporters | |
| everywhere. | |
| So, the easiest way to get your exporters on every node w/o needing docker in | |
| privileged mode: | |
| sudo apt install golang-go | |
| echo export GOPATH=$HOME/go >> ~/.bash_profile | |
| echo export PATH=$PATH:$GOROOT/bin:$GOPATH/bin >> ~/.bash_profile | |
| source ~/.bash_profile | |
| go get github.com/prometheus/node_exporter | |
| cd $GOPATH/src/github.com/prometheus/node_exporter/ | |
| make | |
| sudo ./node_exporter | |
| Note here that I run node_exporter as a sudo privilege. As mentioned it’s for | |
| grabbing the system level metrics, so it was necessary (/proc). Otherwise you’ll get a | |
| lot of error message on not able to read/permissions etc. | |
| KUBERNETES: DON'T FORGET TO ADD YOUR NODES TO THE CONFIG MAP | |
| Once the node exporters are set up correctly on each of the node, and exporting | |
| the metrics, I went back to the master node and modified the configmap for | |
| setting the targets. | |
| In the configmap where we store the configuration for Prometheus, I’ve added the | |
| node name under the following section. | |
| - job_name: 'node_exporter' | |
| static_configs: | |
| -targets: ['localhost:9100', 'ip-node1name:9100', 'ip-node2name:9100'.. ] | |
| Node names could be retrieved by doing | |
| kubectl get nodes | |
| Once this is all set, open the prometheus service on the browser, which runs on | |
| [master node public ip]:9090. | |
| Go into the Status menu, click on Targets in order to double check if the | |
| Prometheus is connecting to all the other nodes right. | |
| Once all the states are ‘UP’ for the nodes, then you are good to go. | |
| Start measuring things! | |
| Advertisements | |
| Share this: | |
| TwitterFacebook | |
| Post navigation | |
| PREVIOUS: Previous post: Back to using pandas and Jupyter | |
| Leave a Reply | |
| Enter your comment here... | |
| Blog at WordPress.com. Claire Keum | |
| Follow | |
| :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment