<p>I tried to deploy prometheus with using <code>https://prometheus-community.github.io/helm-charts</code>
But I wanted to have a custom <code>prometheus.yml</code> Therefore the approach I used is the build the prometheus docker image by copying the customised prometheus.yml file. (via a simple pipeline)</p>
<p>Dockerfile I use</p>
<pre><code>FROM quay.io/prometheus/prometheus:v2.26.0
ADD config /etc/config/
</code></pre>
<p>It builds the image successfully and when I try to deploy this image via the helm,
container fails with the following error.</p>
<pre><code>level=error ts=2021-10-14T15:26:02.525Z caller=main.go:347 msg=&quot;Error loading config (--config.file=/etc/config/prometheus.yml)&quot; err=&quot;open /etc/config/prometheus.yml: no such file or directory&quot;
</code></pre>
<p>I am not sure if this is the ideal approach.
What can I do to have a customised <code>prometheus.yml</code> inside the prometheus pod.
(I can have the config within the values.yaml in helm but I prefer to have a separate file. So I can manage it easily)</p>

<p>The challenege was to manage the prometheus.yml as a seperate file. I have found <code>extraConfigmapMounts</code> option in the community Prometheus stack.</p>
<p>Therefore creating a configMap using the <code>prometheus.yml</code> and mount it to the application seems like a good way of achieving it.
Simply use of the value <code>server.extraConfigmapMounts</code> to add the configuration.</p>
<pre><code>extraConfigmapMounts:
    - name: prometheus-configmap
      mountPath: /prometheus/config/
      subPath: &quot;&quot;
      configMap: &lt;configMap name&gt;
      readOnly: true
</code></pre>
