J'ai un fichier prometheus.yml de base dans mon environnement .. à savoirAutomatiser l'ajout de nouveaux exportateurs de nœuds au tableau des cibles de prometheus.yml
###
apiVersion: v1
kind: ConfigMap
metadata:
creationTimestamp: null
name: prometheus-core
data:
prometheus.yml: |
global:
scrape_interval: 10s
scrape_timeout: 10s
evaluation_interval: 10s
rule_files:
- '/etc/prometheus-rules/*.rules'
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus'
# Override the global default and scrape targets from this job every 5 seconds.
scrape_interval: 5s
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ['localhost:9090']
Maintenant, si j'ajouter de nouveaux noeuds à mon environnement, mon prometheus. fichier YML devrait obtenir mis à jour et ajouter automatiquement les noeuds cibles ci-dessous à savoir
###
apiVersion: v1
kind: ConfigMap
metadata:
creationTimestamp: null
name: prometheus-core
data:
prometheus.yml: |
global:
scrape_interval: 10s
scrape_timeout: 10s
evaluation_interval: 10s
rule_files:
- '/etc/prometheus-rules/*.rules'
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus'
# Override the global default and scrape targets from this job every 5 seconds.
scrape_interval: 5s
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ['localhost:9090','12.10.17.6:9100','12.10.17.19:9100']
peut-on suggérer comment je peux y parvenir?