Skip to content

Feature idea: Custom Sidecars #204

Open
@cognifloyd

Description

@cognifloyd

It might be useful to allow adding custom sidecars to our pods similar to how the prometheus chart does. The prometheus chart also allows templating of the sidecar values, which I'm on the fence about:

in the deployment

      containers:
        - name: ... # the primary container
          ...
      {{- if .Values.server.sidecarContainers }}
        {{- range $name, $spec :=  .Values.server.sidecarContainers }}
        - name: {{ $name }}
          {{- if kindIs "string" $spec }}
            {{- tpl $spec $ | nindent 10 }}
          {{- else }}
            {{- toYaml $spec | nindent 10 }}
          {{- end }}
        {{- end }}
      {{- end }}

in values.yaml

  # sidecarContainers - add more containers to prometheus server
  # Key/Value where Key is the sidecar `- name: <Key>`
  # Example:
  #   sidecarContainers:
  #      webserver:
  #        image: nginx
  sidecarContainers: {}

  # sidecarTemplateValues - context to be used in template for sidecarContainers
  # Example:
  #   sidecarTemplateValues: *your-custom-globals
  #   sidecarContainers:
  #     webserver: |-
  #       {{ include "webserver-container-template" . }}
  # Template for `webserver-container-template` might looks like this:
  #   image: "{{ .Values.server.sidecarTemplateValues.repository }}:{{ .Values.server.sidecarTemplateValues.tag }}"
  #   ...
  #
  sidecarTemplateValues: {}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions