2

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.

How do I add the sidecar containers in the values.yaml 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 https://github.com/helm/charts/issues/12815

jrlonan
  • 45
  • 1
  • 5

2 Answers2

4

Like the comment said, the template is pretty simple.

  {{- if .Values.server.sidecarContainers }}
  {{- toYaml .Values.server.sidecarContainers | nindent 8 }}
  {{- end }}

You can put a values.yaml with your sidecar snippet like below:

server:
  sidecarContainers:
  - name: testSideCar
    image: alpine

And deploy with helm install prom stable/prometheus -f values.yaml. Then you can find your sidecar section in server deployment yaml:

apiVersion: apps/v1
kind: Deployment
spec:
  template:
    spec:
      serviceAccountName: test-prometheus-server
      containers:
        - name: prometheus-server-configmap-reload
          image: "jimmidyson/configmap-reload:v0.3.0"

          <<... omitted ...>>

        - name: testSideCar
          image: alpine
Ken Chen
  • 691
  • 3
  • 16
2

According to configuration section of stable/prometheus chart, you can add server.sidecarContainers

server.sidecarContainers - array of snippets with your sidecar containers for prometheus server

edbighead
  • 5,607
  • 5
  • 29
  • 35