![]() In this quick start demo we have configured Blackbox exporter for Prometheus monitoring on a GKE cluster to probe HTTP, HTTPS endpoints and imported Blackbox dashboards from Grafana dashboards website.- hosts : samplehost user : sampleuser sudo : yes tasks : - name : check exist file stat : path : /usr/bin/blackbox_exporter register : file - name : wget blackbox_exporter get_url : url : dest : /tmp/blackbox_exporter-0.12.0. - name : unarchive blackbox-exporter unarchive : src : /tmp/blackbox_exporter-0.12.0. remote_src : yes dest : /tmp/ - name : copy exporter binary shell : cp /tmp/blackbox_exporter-0.12.0.linux-amd64/blackbox_exporter /usr/bin/blackbox_exporter when : not - name : add system account prometheus user : system : yes name : prometheus state : present home : /var/lib/prometheus shell : /bin/false comment : Prometheus daemon - name : create prometheus home directory file : state : directory path : /var/lib/prometheus mode : 0755 group : prometheus owner : prometheus - name : create blackbox_exporter systemd blockinfile : path : /etc/systemd/system/blackbox_rvice create : yes block : | Description=black_exporter for Prometheus Restart=always User=prometheus ExecStart=/usr/bin/blackbox_exporter \ -web.listen-address=0.0.0.0:9115 \ -config.file=/usr/local/blackbox_exporter/blackbox.yml ExecReload=/bin/kill -HUP $MAINPID TimeoutStopSec=20s SendSIGKILL=no WantedBy=multi-user.target - name : add blackbox_exporter systemd systemd : name : blackbox_exporter. Workaround for this issue configuring Grafana to use Kubernetes StatefulSets or add dashbaord configuration json to Grafana dashboard config map, refer this post. Since we are use Kubernetes deployment for Grafana Pods, whenever Pod gets restarted these dashboards will disappear. Once dashboards are imported you can see Blackbox metric dashboards on Grafana. we already created this in Grafana setup. Then select source, since we are using Prometheus to scrape Blackbox endpoint source will be Prometheus. Then enter the Blackbox dashboard id that we copied and click on load. ![]() Open Grafana console and navigate to Dashbaords section and click on “Import” button to import a dashboard. and search for Blackbox dashboards.Ĭlick on the dashboard that we want to import and copy dashboard id. ![]() Let’s add dashboards for Blackbox exporter metrics Grafana. Now we need to add below Blackbox scrape configuration to Prometheus server configuration and restart the Prometheus service. cloudshell:~/prometheus$ kubectl apply -f blockbox.yamlĬonfigmap/blackbox-exporter-config createdĭeployment.apps/blackbox-exporter created When applied it will create a config map for Blackbox configuration and service for exposing Blackbox pods and a deployment for Blackbox pod management. Apply above configuration using kubectl command. The above configuration monitors HTTP, HTTPS endpoints and SSL certificate expiration dates. Image: "jimmidyson/configmap-reload:v0.2.2" To deploy Blackbox exporter and service on Kubernetes cluster, copy below yaml configuration to blackbox.yaml file. up & and running Grafana Server (For information on how to deploy a Grafana instance, see this post.)Ĭonnect to GKE cluster gcloud container clusters get-credentials demo-k8s-cluster.up & and running Prometheus Server (For information on how to deploy a Prometheus Server, see this post.).Admin privileges on Kubernetes Cluster.kubectl client library to connect to Kubernetes Cluster What Is Blackbox Exporter Creating User For Exporter Configuring Blackbox Exporter Configuring Prometheus For Blackbox Exporter Setup Health Check Alerting. prometheus-blackbox-exporter Share Improve this question Follow asked at 5:39 user1771 142 1 3 8 Add a comment 1 Answer Sorted by: 4 module: 'http2xx', 'tcpconnect' Look for a HTTP 200 response.A Kubernetes cluster(For information on how to deploy a GKE cluster, see this post.).Exporter Setup on Kubernetes Prerequisites: We can use Prometheus to scrap blackbox exporter metrics and create dashboards in Grafana. What is Blackbox Exporter?īlackbox exporter allows blackbox probing of endpoints over HTTP, HTTPS, DNS, TCP, ICMP and gRPC. ![]() In this quick start demo, we are going to do Prometheus Blackbox Exporter setup on Kubernetes cluster to probe HTTP or HTTPS endpoints. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |