<p>I've deployed Prometheus to a Kubernetes cluster using the <code>prometheus-community/kube-prometheus-stack version 13.10.0</code> Helm chart, and would like to edit my <code>prometheus.yml</code> file in the <code>/etc/prometheus/</code> directory.</p>
<p>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.</p>
<p>Is it possible to edit this file?
Describing the pod, I can see the file is created by a secret.</p>
<pre><code>Volumes:
  config:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  prometheus-prometheus-kube-prometheus-prometheus
    Optional:    false
</code></pre>
<p>But I can't find the template that creates this secret anywhere.</p>

<p>Here is the link that seems to be a solution: <a href="https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml#L2108-L2146" rel="nofollow noreferrer">https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml#L2108-L2146</a></p>
<hr />
<p>I decided to provide some short explanation because sometimes links stop working:</p>
<p><code>prometheus-community/kube-prometheus-stack</code> has <em>additionalScrapeConfigs</em> field in the values.yaml file of helm chart.</p>
<p>Here is it's definition:</p>
<pre><code>## 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: []
</code></pre>
