Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mimir-distributed: allow components to override their container image #10340

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions operations/helm/charts/mimir-distributed/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Entries should include a reference to the Pull Request that introduced the chang
## main / unreleased

* [CHANGE] Memcached: Update to Memcached 1.6.34. #10318
* [ENHANCEMENT] Add support for individual components to override their container image. #10340
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've been trying to make the changelog enough for anyone to get the gist of a change and know how to use it. Can you give an example of overriding the image for a component? Something like ingester.image.tag and ingester.image.repository. Or explain that there's an image object under all component objects now

* [BUGFIX] Fix calculation of `mimir.siToBytes` and use floating point arithmetics. #10044

## 5.6.0-rc.0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# General setup
enterprise:
enabled: true
minio:
enabled: false

# Individual components under test
admin_api:
image:
repository: test/admin-api
tag: 1-admin-api

alertmanager:
image:
repository: test/alertmanager
tag: 1-alertmanager

compactor:
image:
repository: test/compactor
tag: 1-compactor

continuous_test:
image:
repository: test/continuous_test
tag: 1-continuous-test

distributor:
image:
repository: test/distributor
tag: 1-distributor

federation_frontend:
enabled: true
image:
repository: test/federation_frontend
tag: 1-federation-frontend

gateway:
image:
repository: test/gateway
tag: 1-gateway

ingester:
image:
repository: test/ingester
tag: 1-ingester

overrides_exporter:
image:
repository: test/overrides_exporter
tag: 1-overrides-exporter

querier:
image:
repository: test/querier
tag: 1-querier

query_frontend:
image:
repository: test/query_frontend
tag: 1-query-frontend

query_scheduler:
image:
repository: test/query_scheduler
tag: 1-query-scheduler

ruler:
image:
repository: test/ruler
tag: 1-ruler

ruler_querier:
image:
repository: test/ruler_querier
tag: 1-ruler-querier

ruler_query_frontend:
image:
repository: test/ruler_query_frontend
tag: 1-ruler-query-frontend

ruler_query_scheduler:
image:
repository: test/ruler_query_scheduler
tag: 1-ruler-query-scheduler

smoke_test:
image:
repository: test/smoke_test
tag: 1-smoke-test

store_gateway:
image:
repository: test/store_gateway
tag: 1-store-gateway
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# General setup
minio:
enabled: false

# Individual components under test
alertmanager:
image:
repository: test/alertmanager
tag: 1-alertmanager

compactor:
image:
repository: test/compactor
tag: 1-compactor

continuous_test:
image:
repository: test/continuous_test
tag: 1-continuous-test

distributor:
image:
repository: test/distributor
tag: 1-distributor

gateway:
image:
repository: test/gateway
tag: 1-gateway

ingester:
image:
repository: test/ingester
tag: 1-ingester

overrides_exporter:
image:
repository: test/overrides_exporter
tag: 1-overrides-exporter

querier:
image:
repository: test/querier
tag: 1-querier

query_frontend:
image:
repository: test/query_frontend
tag: 1-query-frontend

query_scheduler:
image:
repository: test/query_scheduler
tag: 1-query-scheduler

ruler:
image:
repository: test/ruler
tag: 1-ruler

ruler_querier:
image:
repository: test/ruler_querier
tag: 1-ruler-querier

ruler_query_frontend:
image:
repository: test/ruler_query_frontend
tag: 1-ruler-query-frontend

ruler_query_scheduler:
image:
repository: test/ruler_query_scheduler
tag: 1-ruler-query-scheduler

smoke_test:
image:
repository: test/smoke_test
tag: 1-smoke-test

store_gateway:
image:
repository: test/store_gateway
tag: 1-store-gateway
14 changes: 12 additions & 2 deletions operations/helm/charts/mimir-distributed/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,20 @@ Create chart name and version as used by the chart label.
{{- end -}}

{{/*
Calculate image name based on whether enterprise features are requested
Build mimir image reference based on whether enterprise features are requested. The component local values always take precedence.
Params:
ctx = . context
component = component name (optional)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

componentSectionFromName errors out if the component doesn't exist, so i think component isn't optional

*/}}
{{- define "mimir.imageReference" -}}
{{- if .Values.enterprise.enabled -}}{{ .Values.enterprise.image.repository }}:{{ .Values.enterprise.image.tag }}{{- else -}}{{ .Values.image.repository }}:{{ .Values.image.tag }}{{- end -}}
{{- $componentSection := include "mimir.componentSectionFromName" . | fromYaml -}}
{{- $image := $componentSection.image | default dict -}}
{{- if .ctx.Values.enterprise.enabled -}}
{{- $image = mustMerge $image .ctx.Values.enterprise.image -}}
{{- else -}}
{{- $image = mustMerge $image .ctx.Values.image -}}
{{- end -}}
{{ $image.repository }}:{{ $image.tag }}
{{- end -}}

{{/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ spec:
{{- end }}
containers:
- name: admin-api
image: "{{ include "mimir.imageReference" . }}"
image: {{ include "mimir.imageReference" (dict "ctx" . "component" "admin-api") }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-target=admin-api"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ spec:
{{- end }}
containers:
- name: alertmanager
image: "{{ include "mimir.imageReference" . }}"
image: {{ include "mimir.imageReference" (dict "ctx" . "component" "alertmanager") }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-target=alertmanager"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ spec:
{{ toYaml .Values.alertmanager.extraContainers | nindent 8 }}
{{- end }}
- name: alertmanager
image: "{{ include "mimir.imageReference" . }}"
image: {{ include "mimir.imageReference" (dict "ctx" . "component" "alertmanager") }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-target=alertmanager"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ spec:
{{ toYaml .Values.compactor.extraContainers | nindent 8 }}
{{- end }}
- name: compactor
image: "{{ include "mimir.imageReference" . }}"
image: {{ include "mimir.imageReference" (dict "ctx" . "component" "compactor") }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-target=compactor"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ spec:
{{- end }}
containers:
- name: continuous-test
image: "{{ include "mimir.imageReference" . }}"
image: {{ include "mimir.imageReference" (dict "ctx" . "component" "continuous-test") }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-target=continuous-test"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ spec:
{{- end }}
containers:
- name: distributor
image: "{{ include "mimir.imageReference" . }}"
image: {{ include "mimir.imageReference" (dict "ctx" . "component" "distributor") }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-target=distributor"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
{{- end }}
containers:
- name: federation-frontend
image: {{ include "mimir.imageReference" . | quote }}
image: {{ include "mimir.imageReference" (dict "ctx" . "component" "federation-frontend") }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-target=federation-frontend"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
containers:
{{- if $isGEMGateway }}
- name: gateway
image: {{ include "mimir.imageReference" $ | quote }}
image: {{ include "mimir.imageReference" (dict "ctx" $ "component" "gateway") }}
imagePullPolicy: {{ $.Values.image.pullPolicy }}
args:
- "-target=gateway"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
{{ toYaml .Values.graphite.querier.extraContainers | nindent 8 }}
{{- end }}
- name: graphite-querier
image: {{ include "mimir.imageReference" . | quote }}
image: {{ include "mimir.imageReference" (dict "ctx" . "component" "graphite-querier") }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- -target=graphite-querier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
{{ toYaml .Values.graphite.write_proxy.extraContainers | nindent 8 }}
{{- end }}
- name: graphite-write-proxy
image: "{{ include "mimir.imageReference" . }}"
image: {{ include "mimir.imageReference" (dict "ctx" . "component" "graphite-write-proxy") }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- -target=graphite-write-proxy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ spec:
{{ toYaml .Values.ingester.extraContainers | nindent 8 }}
{{- end }}
- name: ingester
image: "{{ include "mimir.imageReference" . }}"
image: {{ include "mimir.imageReference" (dict "ctx" . "component" "ingester") }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-target=ingester"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ spec:
{{- end }}
containers:
- name: overrides-exporter
image: "{{ include "mimir.imageReference" . }}"
image: {{ include "mimir.imageReference" (dict "ctx" . "component" "overrides-exporter") }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-target=overrides-exporter"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ spec:
{{- end }}
containers:
- name: querier
image: "{{ include "mimir.imageReference" . }}"
image: {{ include "mimir.imageReference" (dict "ctx" . "component" "querier") }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-target=querier"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ spec:
{{- end }}
containers:
- name: query-frontend
image: "{{ include "mimir.imageReference" . }}"
image: {{ include "mimir.imageReference" (dict "ctx" . "component" "query-frontend") }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-target=query-frontend"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
{{- end }}
containers:
- name: query-scheduler
image: "{{ include "mimir.imageReference" . }}"
image: {{ include "mimir.imageReference" (dict "ctx" . "component" "query-scheduler") }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-target=query-scheduler"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ spec:
{{- end }}
containers:
- name: ruler-querier
image: "{{ include "mimir.imageReference" . }}"
image: {{ include "mimir.imageReference" (dict "ctx" . "component" "ruler-querier") }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-target=querier"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ spec:
{{- end }}
containers:
- name: ruler-query-frontend
image: "{{ include "mimir.imageReference" . }}"
image: {{ include "mimir.imageReference" (dict "ctx" . "component" "ruler-query-frontend") }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-target=query-frontend"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
{{- end }}
containers:
- name: ruler-query-scheduler
image: "{{ include "mimir.imageReference" . }}"
image: {{ include "mimir.imageReference" (dict "ctx" . "component" "ruler-query-scheduler") }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-target=query-scheduler"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ spec:
{{- end }}
containers:
- name: ruler
image: "{{ include "mimir.imageReference" . }}"
image: {{ include "mimir.imageReference" (dict "ctx" . "component" "ruler") }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-target=ruler"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ spec:
{{- toYaml .Values.smoke_test.initContainers | nindent 8 }}
containers:
- name: smoke-test
image: "{{ include "mimir.imageReference" . }}"
image: {{ include "mimir.imageReference" (dict "ctx" . "component" "smoke-test") }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-target=continuous-test"
Expand Down
Loading
Loading