<p>I'm currently using the prometheus (NOT prometheus-operator, due to historical reasons) Helm charts in our on-premise Kubernetes cluster, and I'd like to deploy the Thanos sidecar.</p>
<p>How do I add the sidecar containers in the <code>values.yaml</code> file? Are there any examples on this that I can refer to? Seems like there are no documentation whatsoever regarding this, as pointed out by this <a href="https://github.com/helm/charts/issues/12815" rel="nofollow noreferrer">https://github.com/helm/charts/issues/12815</a></p>

<p>Like the <a href="https://github.com/helm/charts/issues/12815#issuecomment-528881504" rel="nofollow noreferrer">comment</a> said, the template is pretty simple.</p>
<pre><code>  {{- if .Values.server.sidecarContainers }}
  {{- toYaml .Values.server.sidecarContainers | nindent 8 }}
  {{- end }}
</code></pre>
<p>You can put a values.yaml with your sidecar snippet like below:</p>
<pre><code>server:
  sidecarContainers:
  - name: testSideCar
    image: alpine
</code></pre>
<p>And deploy with <code>helm install prom stable/prometheus -f values.yaml</code>. Then you can find your sidecar section in server deployment yaml:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
spec:
  template:
    spec:
      serviceAccountName: test-prometheus-server
      containers:
        - name: prometheus-server-configmap-reload
          image: &quot;jimmidyson/configmap-reload:v0.3.0&quot;

          &lt;&lt;... omitted ...&gt;&gt;

        - name: testSideCar
          image: alpine
</code></pre>
