Learn Kubernetes in a Month of Lunches by Elton Stoneman
Author:Elton Stoneman [Stoneman, Elton]
Language: eng
Format: epub, mobi
Publisher: Manning Publications Co.
Published: 0101-01-01T00:00:00+00:00
Figure 14.2 No targets yet, but Prometheus will keep checking the Kubernetes API for new Pods.
Configuring Prometheus to find targets in Kubernetes is fairly straightforward, although the terminology is confusing at first. Prometheus uses jobs to define a related set of targets to scrape, which could be multiple components of an application. The scrape configuration can be as simple as a static list of domain names, which Prometheus polls to grab the metrics, or it can use dynamic service discovery. Listing 14.1 shows the beginning of the test-pods job configuration, which uses the Kubernetes API for service discovery.
Listing 14.1 prometheus-config.yaml, scrape configuration with Kubernetes
scrape_configs: # This is the YAML inside the ConfigMap. - job_name: 'test-pods' # Used for test apps kubernetes_sd_configs: # Finds targets from the Kubernetes API - role: pod # Searches for Pods relabel_configs: # Applies these filtering rules - source_labels: - __meta_kubernetes_namespace action: keep # Includes Pods only where the namespace regex: kiamol-ch14-test # is the test namespace for this chapter
Itâs the relabel_configs section that needs explanation. Prometheus stores metrics with labels, which are key-value pairs that identify the source system and other relevant information. Youâll use labels in queries to select or aggregate metrics, and you can also use them to filter or modify metrics before they are stored in Prometheus. This is relabeling, and conceptually, itâs similar to the data pipeline in Fluent Bitâitâs your chance to discard data you donât want and reshape the data you do want.
Regular expressions rear their unnecessarily complicated heads in Prometheus, too, but itâs rare that you need to make changes. The pipeline you set up in the relabeling phase should be generic enough to work for all your apps. The full pipeline in the configuration file applies the following rules:
Include Pods only from the namespace kiamol-ch14-test.
Download
Learn Kubernetes in a Month of Lunches by Elton Stoneman.mobi
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
API Testing and Development with Postman by Dave Westerveld(3644)
Learning C# by Developing Games with Unity 2020 by Harrison Ferrone(2640)
Software Architecture for Busy Developers by Stéphane Eyskens(2344)
2021 Beginners Guide to Python Programming Language: A Crash Course to Mastering Python in One Hour by Elmer Gary & Elmer Gary(1884)
Machine Learning for Algorithmic Trading by Stefan Jansen(1632)
Hands-On ROS for Robotics Programming by Bernardo Ronquillo Japón(1576)
Delphi GUI Programming with FireMonkey by Andrea Magni(1457)
Game Development Projects with Unreal Engine by Hammad Fozi & Goncalo Marques & David Pereira & Devin Sherry(1403)
Cloud Native with Kubernetes by Alexander Raul(1376)
Datadog Cloud Monitoring Quick Start Guide by Thomas Kurian Theakanath(1348)
Software Architecture Patterns for Serverless Systems by John Gilbert(1339)
Practical Node-RED Programming by Taiji Hagino(1336)
Automate It with Zapier by Kelly Goss(1321)
Practical System Programming for Rust Developers by Prabhu Eshwarla(1312)
Delphi Programming Projects by William Duarte(1297)
Mastering React Test-Driven Development by Daniel Irvine(1290)
Developing Multi-Platform Apps with Visual Studio Code by Ovais Mehboob Ahmed Khan & Khusro Habib & Chris Dias(1255)
Ghidra Software Reverse Engineering for Beginners by A. P. David(1245)
Learn Spring for Android Application Development by S. M. Mohi Us Sunnat(1236)
