I've deployed Prometheus to a Kubernetes cluster using the prometheus-community/kube-prometheus-stack version 13.10.0
Helm chart, and would like to edit my prometheus.yml
file in the /etc/prometheus/
directory.
The reason for this is I need to add an extra scrape config for Jenkins as I'm unable to do it dynamically via an additional service monitor.
Is it possible to edit this file? Describing the pod, I can see the file is created by a secret.
Volumes:
config:
Type: Secret (a volume populated by a Secret)
SecretName: prometheus-prometheus-kube-prometheus-prometheus
Optional: false
But I can't find the template that creates this secret anywhere.
Here is the link that seems to be a solution: https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml#L2108-L2146
I decided to provide some short explanation because sometimes links stop working:
prometheus-community/kube-prometheus-stack
has additionalScrapeConfigs field in the values.yaml file of helm chart.
Here is it's definition:
## AdditionalScrapeConfigs allows specifying additional Prometheus scrape configurations. Scrape configurations
## are appended to the configurations generated by the Prometheus Operator. Job configurations must have the form
## as specified in the official Prometheus documentation:
## https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config. As scrape configs are
## appended, the user is responsible to make sure it is valid. Note that using this feature may expose the possibility
## to break upgrades of Prometheus. It is advised to review Prometheus release notes to ensure that no incompatible
## scrape configs are going to break Prometheus after the upgrade.
##
## The scrape configuration example below will find master nodes, provided they have the name .*mst.*, relabel the
## port to 2379 and allow etcd scraping provided it is running on all Kubernetes master nodes
##
additionalScrapeConfigs: []